From 16a1d188c623c961ff7c7269b3f43223e4c37526 Mon Sep 17 00:00:00 2001 From: gracekim527 Date: Sun, 3 Nov 2024 01:17:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?:lipstick:=20Style:=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20=ED=8E=98=EC=9D=B4=EC=A7=80=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Router.tsx | 2 + src/components/common/dropdown/Dropdown.tsx | 97 +++++++++++++++ src/components/common/input/style.ts | 1 + src/components/common/radio/Radio.tsx | 123 ++++++++++++++++++++ src/components/common/textarea/Textarea.tsx | 36 ++++++ src/components/personal/ImgInput.tsx | 74 ++++++++++++ src/pages/personal/Personal.tsx | 121 +++++++++++++++++++ 7 files changed, 454 insertions(+) create mode 100644 src/components/common/dropdown/Dropdown.tsx create mode 100644 src/components/common/radio/Radio.tsx create mode 100644 src/components/common/textarea/Textarea.tsx create mode 100644 src/components/personal/ImgInput.tsx create mode 100644 src/pages/personal/Personal.tsx diff --git a/src/Router.tsx b/src/Router.tsx index 8f0e161..64031fa 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -4,6 +4,7 @@ import Login from "./pages/login/Login"; import Create from "@pages/create/Create"; import Test from "@pages/test/Test"; import Invite from "@pages/invite/Invite"; +import Personal from "@pages/personal/Personal"; const Router: React.FC = () => { return ( @@ -13,6 +14,7 @@ const Router: React.FC = () => { } /> } /> } /> + } /> ); diff --git a/src/components/common/dropdown/Dropdown.tsx b/src/components/common/dropdown/Dropdown.tsx new file mode 100644 index 0000000..e615d64 --- /dev/null +++ b/src/components/common/dropdown/Dropdown.tsx @@ -0,0 +1,97 @@ +import React from "react"; +import styled from "styled-components"; + +interface Option { + value: string; + label: string; +} + +interface DropdownProps { + label: string; + essential: boolean; + options: Option[]; + selectedOption: string; + onChange: (value: string) => void; + placeholder?: string; +} + +const Dropdown: React.FC = ({ + label, + essential, + options, + selectedOption, + onChange, + placeholder, +}) => { + const handleSelectChange = (event: React.ChangeEvent) => { + onChange(event.target.value); + }; + + return ( + + + {label} + {essential && *} + + + + {options.map((option) => ( + + ))} + + + ); +}; + +export default Dropdown; + +const Container = styled.div` + display: flex; + flex-direction: column; + gap: 10px; +`; + +const TitleWrapper = styled.div` + display: flex; + align-items: center; + gap: 5px; +`; + +const SelectBox = styled.select` + width: 340px; + height: 40px; + border-radius: 8px; + border: 1px solid #ced4da; + background: #fff; + padding: 10px; + color: #343a40; + outline: none; + color: #495057; + font-family: Pretendard; + font-size: 12px; + font-weight: 500; + line-height: 12px; /* 100% */ + letter-spacing: -0.1px; +`; + +const InputTitle = styled.label` + color: #343a40; + + font-size: 12px; + font-style: normal; + font-weight: 500; + line-height: 22px; + letter-spacing: -0.1px; +`; + +const EssentialIcon = styled.span` + color: #f5535e; + + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 18px; + letter-spacing: -0.1px; +`; diff --git a/src/components/common/input/style.ts b/src/components/common/input/style.ts index e7a8eda..345e264 100644 --- a/src/components/common/input/style.ts +++ b/src/components/common/input/style.ts @@ -7,6 +7,7 @@ interface InputWrapProps { export const InputContainer = styled.div` display: flex; flex-direction: column; + gap: 10px; `; export const InputTitleWrapper = styled.div` diff --git a/src/components/common/radio/Radio.tsx b/src/components/common/radio/Radio.tsx new file mode 100644 index 0000000..3f46e34 --- /dev/null +++ b/src/components/common/radio/Radio.tsx @@ -0,0 +1,123 @@ +import React from "react"; +import styled, { css } from "styled-components"; + +interface Option { + value: string; + label: string; +} + +interface RadioGroupProps { + label: string; + options: Option[]; + selectedOption: string; + onChange: (value: string) => void; +} + +interface LabelProps { + isSelected: boolean; +} + +const RadioGroup: React.FC = ({ + label, + options, + selectedOption, + onChange, +}) => { + return ( + + + {label} + * + + + {options.map((option) => ( + + ))} + + + ); +}; + +export default RadioGroup; + +const Container = styled.div` + display: flex; + flex-direction: column; + gap: 10px; +`; + +const RadioGroupContainer = styled.div` + display: flex; + justify-content: space-between; +`; + +const Label = styled.label` + display: flex; + align-items: center; + cursor: pointer; + color: #495057; + font-family: Pretendard; + font-size: 12px; + font-weight: 500; + line-height: 12px; /* 100% */ + letter-spacing: -0.1px; + width: 160px; + height: 40px; + border-radius: 8px; + border: 1px solid #ced4da; + background: #fff; + + ${({ isSelected }) => + isSelected && + css` + background: #bfd8af; + border-color: #868e96; + color: #495057; + font-weight: 600; + `} +`; + +const RadioInput = styled.input` + margin-right: 8px; + accent-color: #6c757d; + cursor: pointer; + opacity: 0; +`; + +const TitleWrapper = styled.div` + display: flex; + align-items: center; + gap: 5px; +`; + +const InputTitle = styled.label` + color: #343a40; + + font-size: 12px; + font-style: normal; + font-weight: 500; + line-height: 22px; + letter-spacing: -0.1px; +`; + +export const EssentialIcon = styled.span` + color: #f5535e; + + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: 18px; + letter-spacing: -0.1px; +`; diff --git a/src/components/common/textarea/Textarea.tsx b/src/components/common/textarea/Textarea.tsx new file mode 100644 index 0000000..34794e3 --- /dev/null +++ b/src/components/common/textarea/Textarea.tsx @@ -0,0 +1,36 @@ +import styled from "styled-components"; + +export default function Textarea() { + return ( + + 개발 언어 / 스택 +