From 5a10e0279798f65dfff2885994e0cd7d23197a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=94=ED=82=A4=EC=B0=AC?= Date: Wed, 14 Feb 2024 17:41:48 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=85=ED=95=A8=20=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20=EB=B3=B5=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Alert.js | 6 ++---- src/component/BusunessCard.js | 15 ++++++++++++++- src/section/FirstSection.js | 18 ------------------ 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/component/Alert.js b/src/component/Alert.js index 698269e..9f268e5 100644 --- a/src/component/Alert.js +++ b/src/component/Alert.js @@ -1,8 +1,6 @@ import styled, {css} from "styled-components"; import {useEffect, useState} from "react"; -import { v4 } from "uuid"; -import {UI_ACTION_TYPE, useUiDispatch, useUiState} from "../context/UiReducer"; -import {logDOM} from "@testing-library/react"; +import {UI_ACTION_TYPE, useUiDispatch} from "../context/UiReducer"; import {GoX} from "react-icons/go"; import {IconButton} from "./IconButton"; import {CSSTransition, TransitionGroup} from "react-transition-group"; @@ -60,7 +58,7 @@ const AlertMessageStyle = styled.li` } p { - margin-top: 4px; + margin-top: 2px; } ` diff --git a/src/component/BusunessCard.js b/src/component/BusunessCard.js index 512dac5..0d7691b 100644 --- a/src/component/BusunessCard.js +++ b/src/component/BusunessCard.js @@ -2,6 +2,8 @@ import styled from "styled-components"; import edcanLogo from "./../assets/edcan.svg" import edcanTypo from "./../assets/edcan_typo.svg" import {SCoreDream} from "../style/Font"; +import {UI_ACTION_TYPE, useUiDispatch} from "../context/UiReducer"; +import {v4} from "uuid"; const BusinessCardStyle = styled.div` width: 300px; @@ -161,6 +163,8 @@ const BusinessCardStyle = styled.div` ` export const BusinessCard = ({onMouseMove, onMouseOut, cardState}) => { + const uiDispatch = useUiDispatch() + const cardStyle = { transform: `perspective(2000px) rotateX(${cardState.xDeg}deg) rotateY(${cardState.yDeg}deg)` }; @@ -171,7 +175,16 @@ export const BusinessCard = ({onMouseMove, onMouseOut, cardState}) => { } const onEmailCopy = () => { - navigator.clipboard.writeText("me@kichan.dev") + navigator.clipboard.writeText("me@kichan.dev").then(() => { + uiDispatch({ + type: UI_ACTION_TYPE.alert_message_add, + message: { + id: v4(), + title: "메일 주소 복사 완료", + message: "메일 주소를 복사했어요" + } + }) + }) } return ( diff --git a/src/section/FirstSection.js b/src/section/FirstSection.js index a7aad44..10e4329 100644 --- a/src/section/FirstSection.js +++ b/src/section/FirstSection.js @@ -1,9 +1,6 @@ import styled from "styled-components"; import {downUp, showLeft, animation, showRight} from "../style/animation"; import {GoChevronDown} from "react-icons/go"; -import {UI_ACTION_TYPE, useUiDispatch} from "../context/UiReducer"; -import Button from "../component/Button"; -import {v4} from "uuid"; const FirstSectionStyle = styled.section` width: 100%; @@ -109,8 +106,6 @@ const FirstSectionStyle = styled.section` ` export const FirstSection = () => { - const dispatch = useUiDispatch() - const scrollDown = () => { window.scrollTo({ left: 0, @@ -119,17 +114,6 @@ export const FirstSection = () => { }) } - const add = () => { - dispatch({ - type: UI_ACTION_TYPE.alert_message_add, - message: { - id: v4(), - title: "ㅎㅇ", - message: "어 그래" - } - }) - } - return (
@@ -168,8 +152,6 @@ export const FirstSection = () => {
- -
)