Skip to content

Commit

Permalink
✨ Feat: 팀원 초대 페이지 구현 (moyeothon#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
GraceKim527 committed Nov 1, 2024
1 parent 0083fd8 commit f8528fc
Show file tree
Hide file tree
Showing 17 changed files with 441 additions and 7 deletions.
101 changes: 101 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"preview": "vite preview"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"path": "^0.12.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 2 additions & 0 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import { BrowserRouter, Route, Routes } from "react-router-dom";
import Login from "./pages/login/Login";
import Create from "@pages/create/Create";
import Invite from "@pages/invite/Invite";

const Router: React.FC = () => {
return (
<BrowserRouter>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/create" element={<Create />} />
<Route path="/invite" element={<Invite />} />
</Routes>
</BrowserRouter>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const Btn = styled.button`
interface ButtonProps {
link: string;
name: string;
type: string;
type?: string;
}

const Button: React.FC<ButtonProps> = ({ link, name, type }) => {
Expand Down
File renamed without changes.
47 changes: 47 additions & 0 deletions src/components/common/hintText/HintText2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import styled from "styled-components";

const HintTextWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: column;
gap: 10px;
`;

const HintTextHeadline2 = styled.h2`
color: #343a40;
font-family: "Pretendard";
font-size: 28px;
font-style: normal;
font-weight: 600;
line-height: 30px;
letter-spacing: -0.5px;
`;

const HintTextP1 = styled.p`
width: 300px;
color: #868e96;
font-family: "Pretendard";
font-size: 14px;
font-style: normal;
font-weight: 500;
@media (max-width: 360px) {
width: 280px;
}
`;

interface TextProps {
headline: string;
paragraph: string;
}

const HintText2: React.FC<TextProps> = ({ headline, paragraph }) => {
return (
<HintTextWrapper>
<HintTextHeadline2>{headline}</HintTextHeadline2>
<HintTextP1>{paragraph}</HintTextP1>
</HintTextWrapper>
);
};

export default HintText2;
File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 43 additions & 0 deletions src/components/invite/profile/ActivatedProfile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import * as S from "./style";

interface ProfileProps {
name: string;
position: string;
part: string;
imgSrc?: string;
url?: string;
}

const ActivatedProfile: React.FC<ProfileProps> = ({
name,
position,
part,
imgSrc,
url,
}) => {
const handleClick = () => {
if (url) {
window.location.href = url;
}
};

return (
<S.Container
onClick={handleClick}
style={{ cursor: url ? "pointer" : "default" }}
>
<div>
<S.Img src={imgSrc} alt={`${name}'s profile`} />
</div>
<S.InformWrap>
<S.InformDetailWrap>
<S.Name>{name}</S.Name>
<S.Position>{position}</S.Position>
</S.InformDetailWrap>
<S.Part>{part}</S.Part>
</S.InformWrap>
</S.Container>
);
};

export default ActivatedProfile;
16 changes: 16 additions & 0 deletions src/components/invite/profile/DeactivatedProfile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as S from "./style";

export default function DeactivatedProfile() {
const handleClick = () => {
window.location.href = "#";
};

return (
<S.DeactivatedContainer onClick={handleClick}>
<S.Hint>
아직 팀원 정보가 입력되지 않았어요! <br /> URL을 공유하여 팀원을
초대해주세요.
</S.Hint>
</S.DeactivatedContainer>
);
}
88 changes: 88 additions & 0 deletions src/components/invite/profile/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import styled from "styled-components";

export const Container = styled.div`
width: 350px;
height: 80px;
display: flex;
align-items: center;
padding: 14px 10px;
gap: 10px;
border-radius: 20px;
background: #bfd8af;
@media (max-width: 360px) {
width: 280px;
}
`;

export const Img = styled.img`
width: 54px;
height: 54px;
border-radius: 27px;
`;

export const InformWrap = styled.div`
display: flex;
flex-direction: column;
gap: 6px;
`;

export const InformDetailWrap = styled.div`
display: flex;
align-items: center;
gap: 6px;
`;

export const Name = styled.h3`
color: #343a40;
font-family: Pretendard;
font-size: 20px;
font-style: normal;
font-weight: 600;
line-height: 20px;
letter-spacing: -0.5px;
`;

export const Position = styled.p`
color: #868e96;
text-align: center;
font-family: Pretendard;
font-size: 14px;
font-style: normal;
font-weight: 300;
line-height: 14px;
letter-spacing: -0.5px;
`;

export const Part = styled.p`
color: #495057;
font-family: Pretendard;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 14px;
letter-spacing: -0.5px;
`;

export const DeactivatedContainer = styled.div`
width: 350px;
height: 80px;
border-radius: 20px;
border: 2px dashed #dee2e6;
background: #fff;
padding: 18px;
@media (max-width: 360px) {
width: 280px;
}
`;

export const Hint = styled.p`
color: #868e96;
font-family: Pretendard;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px;
letter-spacing: -0.5px;
`;
28 changes: 28 additions & 0 deletions src/components/invite/urlCopy/UrlCopy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { faCopy } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import * as S from "./style";

export default function UrlCopy() {
const url = "https://www.syncup.com/234asdf94al4";

const handleCopy = async () => {
try {
await navigator.clipboard.writeText(url);
alert("URL이 복사되었습니다.");
} catch (err) {
console.error("Failed to copy text: ", err);
}
};

return (
<S.Container>
<S.Url>{url}</S.Url>
<S.Icon onClick={handleCopy}>
<FontAwesomeIcon
icon={faCopy}
style={{ width: "16px", height: "16px", color: "#868E96" }}
/>
</S.Icon>
</S.Container>
);
}
Loading

0 comments on commit f8528fc

Please sign in to comment.