Skip to content

Commit

Permalink
명함 메일 주소 복사
Browse files Browse the repository at this point in the history
  • Loading branch information
kichan05 committed Feb 14, 2024
1 parent 8f89c22 commit 5a10e02
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
6 changes: 2 additions & 4 deletions src/component/Alert.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -60,7 +58,7 @@ const AlertMessageStyle = styled.li`
}
p {
margin-top: 4px;
margin-top: 2px;
}
`

Expand Down
15 changes: 14 additions & 1 deletion src/component/BusunessCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)`
};
Expand All @@ -171,7 +175,16 @@ export const BusinessCard = ({onMouseMove, onMouseOut, cardState}) => {
}

const onEmailCopy = () => {
navigator.clipboard.writeText("[email protected]")
navigator.clipboard.writeText("[email protected]").then(() => {
uiDispatch({
type: UI_ACTION_TYPE.alert_message_add,
message: {
id: v4(),
title: "메일 주소 복사 완료",
message: "메일 주소를 복사했어요"
}
})
})
}

return (
Expand Down
18 changes: 0 additions & 18 deletions src/section/FirstSection.js
Original file line number Diff line number Diff line change
@@ -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%;
Expand Down Expand Up @@ -109,8 +106,6 @@ const FirstSectionStyle = styled.section`
`

export const FirstSection = () => {
const dispatch = useUiDispatch()

const scrollDown = () => {
window.scrollTo({
left: 0,
Expand All @@ -119,17 +114,6 @@ export const FirstSection = () => {
})
}

const add = () => {
dispatch({
type: UI_ACTION_TYPE.alert_message_add,
message: {
id: v4(),
title: "ㅎㅇ",
message: "어 그래"
}
})
}

return (
<FirstSectionStyle>
<div className="title-wrap">
Expand Down Expand Up @@ -168,8 +152,6 @@ export const FirstSection = () => {
</div>
</div>

<Button onClick={add}>추가</Button>

<GoChevronDown className={"go-down"} onClick={scrollDown}/>
</FirstSectionStyle>
)
Expand Down

0 comments on commit 5a10e02

Please sign in to comment.