-
Notifications
You must be signed in to change notification settings - Fork 0
[#109] 마이페이지 6-2 분할 첫번째 #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chan0310
wants to merge
3
commits into
main
Choose a base branch
from
feat/#92_1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions
55
src/components/myPage/assignesAbout/Header/Header.styles.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { COLORS } from '@/styles/constants/colors'; | ||
| import styled from '@emotion/styled'; | ||
|
|
||
| // 가독성을 위해 스타일 파일은 별도로 둡니다. | ||
|
|
||
| interface SubmitBoxnProps { | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
| margin?:number; | ||
| } | ||
|
|
||
| export const SubmitBox = styled.div<SubmitBoxnProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '390px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '46px')}; | ||
| margin-top: ${(props) => (props.margin ? `${props.margin}px` : '0px')}; | ||
| border-radius: 12px; | ||
| text-align: center; | ||
| margin-right:17px; | ||
|
|
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
|
|
||
| `; | ||
|
|
||
|
|
||
| interface SubmitBoxButtonnProps { | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
| } | ||
| export const SubmitBoxButton = styled.div<SubmitBoxButtonnProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '18px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '18px')}; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| font-size:18px; | ||
| `; | ||
|
|
||
| interface SubmitBoxTitleProps { | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
| } | ||
| export const SubmitBoxTitle = styled.div<SubmitBoxTitleProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '52px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '30px')}; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| font-size:20px; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 공통 텍스트 스타일 사용해주세요! |
||
| `; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { SubmitBox,SubmitBoxButton,SubmitBoxTitle } from "./Header.styles"; | ||
|
|
||
| interface SubmitHeadernProps { | ||
| label?: string; | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
|
|
||
| onClose?:()=>void; | ||
| } | ||
|
|
||
| const SubmitHeader = ({onClose,width,label}: SubmitHeadernProps) => ( | ||
| <> | ||
| <SubmitBox width={width}> | ||
| <SubmitBoxButton width={28} onClick={onClose}> | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> | ||
| <path d="M12 2l-10 10 10 10 2-2-8-8 8-8z"/> | ||
| </svg> | ||
| </SubmitBoxButton> | ||
| <SubmitBoxTitle width={100}>{label}</SubmitBoxTitle> | ||
| <SubmitBoxTitle width={28}></SubmitBoxTitle> | ||
| </SubmitBox> | ||
| </> | ||
| ); | ||
|
|
||
| export default SubmitHeader; |
21 changes: 21 additions & 0 deletions
21
src/components/myPage/assignesAbout/HorizontalLine/HorizontalLine.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import React from 'react'; | ||
| import { COLORS } from '@/styles/constants/colors'; | ||
| // HorizontalLine.js | ||
| import styled from 'styled-components'; | ||
| interface HorizontalLineProps { | ||
| width?: number; | ||
| color?: string; | ||
| height?:number; | ||
| } | ||
|
|
||
| const HorizontalLineWrapper = styled.div<HorizontalLineProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '400px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '1px')}; | ||
| background-color: ${(props) => (props.color ? `${props.color}` : `${COLORS.grayscale.Gray1}`)}; | ||
| margin: 10px 0; | ||
| `; | ||
| const HorizontalLine = ({ width, height }: HorizontalLineProps) => { | ||
| return <HorizontalLineWrapper width={width} height={height} />; | ||
| }; | ||
|
|
||
| export default HorizontalLine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { COLORS } from '@/styles/constants/colors'; | ||
| import {TEXT_STYLES} from '@/styles/constants/textStyles'; | ||
| import styled from '@emotion/styled'; | ||
| import React from 'react'; // React import 추가 | ||
|
|
||
| interface Props { | ||
| width?: number; | ||
| height?: number; | ||
| color:string; | ||
| margin?:number; | ||
| } | ||
|
|
||
| export const SubjectCard = styled.div<Props>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '100px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '73px')}; | ||
| margin-left:${(props) => (props.margin ? `${props.margin}px` : '5px')}; | ||
|
|
||
| border-radius: 15px; | ||
| background-color: ${(props) => (props.color ? `${props.color}` : `${COLORS.grayscale.Gray5}`)}; | ||
|
|
||
| display: flex; | ||
| flex-direction: row; | ||
| align-items: center; | ||
|
|
||
| box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); | ||
| `; | ||
|
|
||
| interface Props2 { | ||
| fontSize?: number; | ||
| color?:string; | ||
| fontFamily?: string; | ||
| letterSpacing?: number; | ||
| fontWeight?: number; | ||
|
|
||
| } | ||
| export const SubjectCardText = styled.div<Props2>` | ||
| width:80px; | ||
| color: ${(props) => (props.color ? `${props.color}` : COLORS.grayscale.Gray1)}; | ||
| font-size: ${(props) => (props.fontSize ? `${props.fontSize+3}px` : `${TEXT_STYLES.CapR14.fontSize}px` )}; | ||
| font-weight: ${(props) => (props.fontWeight ? `${props.fontWeight}` : TEXT_STYLES.CapR14.fontWeight)}; | ||
| letter-spacing: ${(props) => (props.letterSpacing ? `${props.letterSpacing}` : TEXT_STYLES.CapR14.letterSpacing)}; | ||
| font-family: ${(props) => (props.fontFamily ? `${props.fontFamily}` : TEXT_STYLES.CapR14.fontFamily)}; | ||
| margin-bottom: 10px; | ||
| `; |
47 changes: 47 additions & 0 deletions
47
src/components/myPage/assignesAbout/attendance_table/each_week.styles.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { COLORS } from '@/styles/constants/colors'; | ||
| import styled from '@emotion/styled'; | ||
| import { TEXT_STYLES } from '@/styles/constants/textStyles'; | ||
|
|
||
| // 가독성을 위해 스타일 파일은 별도로 둡니다. | ||
|
|
||
| interface weekBoxProps { | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
| text?:keyof typeof TEXT_STYLES; | ||
| } | ||
|
|
||
|
|
||
| export const weekBox = styled.td<weekBoxProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '155px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '74px')}; | ||
| text-align: left; | ||
|
|
||
| color: ${(props) => (props.color ? `${props.color}` : COLORS.grayscale.Gray1)}; | ||
| font-size: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].fontSize}px` : `${TEXT_STYLES.CapM14.fontSize}px` )}; | ||
| font-weight: ${(props) => (props.text? `${TEXT_STYLES[props.text!].fontWeight}` : TEXT_STYLES.CapM14.fontWeight)}; | ||
| letter-spacing: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].letterSpacing}` : TEXT_STYLES.CapM14.letterSpacing)}; | ||
| font-family: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].fontFamily}` : TEXT_STYLES.CapM14.fontFamily)}; | ||
| margin-top:5px; | ||
| padding-left:15px | ||
| `; | ||
|
|
||
| export const smallBox = styled.td<weekBoxProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '155px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '37px')}; | ||
| text-align: left; | ||
|
|
||
| color: ${(props) => (props.color ? `${props.color}` : COLORS.grayscale.Gray1)}; | ||
| font-size: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].fontSize}px` : `${TEXT_STYLES.CapR12.fontSize}px` )}; | ||
| font-weight: ${(props) => (props.text? `${TEXT_STYLES[props.text!].fontWeight}` : TEXT_STYLES.CapR12.fontWeight)}; | ||
| letter-spacing: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].letterSpacing}` : TEXT_STYLES.CapR12.letterSpacing)}; | ||
| font-family: ${(props) => (props.text ? `${TEXT_STYLES[props.text!].fontFamily}` : TEXT_STYLES.CapR12.fontFamily)}; | ||
| margin-top:5px | ||
| `; | ||
|
|
||
| export const smallBox2 = styled.td<weekBoxProps>` | ||
| width: ${(props) => (props.width ? `${props.width}px` : '80px')}; | ||
| height: ${(props) => (props.height ? `${props.height}px` : '37px')}; | ||
| text-align: center; | ||
| `; | ||
|
|
46 changes: 46 additions & 0 deletions
46
src/components/myPage/assignesAbout/attendance_table/each_week.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import * as styles from "./each_week.styles" | ||
|
|
||
| interface SubmitHeadernProps { | ||
| label?: string; | ||
| width?: number; | ||
| height?: number; | ||
| color?: string; | ||
|
|
||
| weekN:number; | ||
| attList:Array<number> | ||
|
|
||
| } | ||
|
|
||
| const EachWeekAttendance = ({weekN,attList,color}: SubmitHeadernProps) => { | ||
| const rows_num=attList.length; | ||
| const mapNumberToText = (number:number) => { | ||
| switch (number) { | ||
| case 1: | ||
| return '/assets/icon/Shape/Ellipse.svg'; //출석 | ||
| case 2: | ||
| return '/assets/icon/Shape/Triangle.svg'; //지각 | ||
| case 3: | ||
| return '/assets/icon/Shape/X.svg';//결석 | ||
| default: | ||
| return ; | ||
| } | ||
| }; | ||
| const attIconList=attList.map(mapNumberToText) | ||
| const smallBoxHeight=74/rows_num; | ||
| return (<> | ||
| <tr style={{backgroundColor:color}}> | ||
| <styles.weekBox rowSpan={rows_num}>{weekN}주차</styles.weekBox> | ||
| <styles.smallBox height={smallBoxHeight}>1차시</styles.smallBox> | ||
| <styles.smallBox2 height={smallBoxHeight}><img src={attIconList[0]}/></styles.smallBox2> | ||
| </tr> | ||
|
|
||
| {attIconList.slice(1,rows_num).map((item, index) => ( | ||
| <tr style={{backgroundColor:color}}> | ||
| <styles.smallBox height={smallBoxHeight}>{index+2}차시</styles.smallBox> | ||
| <styles.smallBox2 height={smallBoxHeight}><img src={item}/></styles.smallBox2> | ||
| </tr> | ||
| ))} | ||
| </>) | ||
| }; | ||
|
|
||
| export default EachWeekAttendance; |
91 changes: 91 additions & 0 deletions
91
src/components/myPage/assignesAbout/my_assign_comps/my_page_ann_view.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
|
|
||
| import React, { ChangeEvent, useState } from 'react'; | ||
| import { Subject } from '@/components/myPage/assignesAbout/subjects_data'; | ||
| import SubmitHeader from '@/components/myPage/assignesAbout/Header/Header'; | ||
| import { COLORS } from '@/styles/constants/colors'; | ||
| import HorizontalLine from '@/components/myPage/assignesAbout/HorizontalLine/HorizontalLine'; | ||
| import * as style from "@/components/myPage/assignesAbout/total.styles" | ||
| import { TEXT_STYLES } from '@/styles/constants/textStyles'; | ||
| import AnnouncemeDownLoadFile from '@/components/myPage/assignesAbout/my_page_announce/donwload_file_ann'; | ||
| interface FormData_d { | ||
| subject:Subject; | ||
| width:number; | ||
| assIndex:number; | ||
| } | ||
| const MypageAssignList: React.FC<FormData_d> = ({ width,subject,assIndex }) => { | ||
| const [formData, setFormData] = useState<FormData_d>({ | ||
| subject:subject, | ||
| width: width, | ||
| assIndex: assIndex, | ||
| }); | ||
| const text_m="information my information, your information shallo \n infor infor"; | ||
| formData.subject= new Subject("웹프로그래밍 (가)","2028년 19학기-34",1241523); | ||
| formData.subject.add_assign_data("과제1",new Date(2023,4,5),new Date(2023,12,3),new Date(2023,12,29),"information","cor",10,8) | ||
| formData.subject.add_assign_data("과제2",new Date(2023,4,5),new Date(2223,3),new Date(2023,12,29),"information","cor",10,8) | ||
| formData.subject.add_assign_data("기말고사 공지",new Date(2023,4,5),new Date(2223,3),new Date(2023,12,29),text_m,"cor",10,8) | ||
| formData.width=390; | ||
| formData.assIndex=0; | ||
|
|
||
| function load_subjects(){ | ||
| //subject API로 받아와야됨 | ||
| } | ||
| function before_page(){ | ||
| //이전페이지로 | ||
| } | ||
| return ( | ||
| <div style={{display: "flex", | ||
| flexDirection: "column", | ||
| alignItems: "center", width:`${formData.width}`}}> | ||
| <SubmitHeader width={formData.width} onClose={before_page} label="공지"/> | ||
|
|
||
| <style.MyAssignTitleBox height={84}> | ||
| <style.MyAssignTitleBoxText color={COLORS.grayscale.Black} | ||
| fontSize={TEXT_STYLES.HeadM18.fontSize+5} fontFamily={TEXT_STYLES.HeadM18.fontFamily} | ||
| fontWeight={TEXT_STYLES.HeadM18.fontWeight} letterSpacing={TEXT_STYLES.HeadM18.letterSpacing} | ||
| > {formData.subject.get_assign_title(2)} | ||
| </style.MyAssignTitleBoxText> | ||
| <div style={{height:"5px"}}></div> | ||
| <div style={{ width:"80px" ,display: "flex", | ||
| justifyContent: "space-between", alignItems: "center"}}> | ||
| <img src="/assets/icon/Nav/calendar_off.svg" style={{marginTop:"2px", | ||
| alignSelf: "flex-start", | ||
| width: "20px", marginRight:"4px"}}/> | ||
| <style.MyAssignTitleBoxText>{formData.subject.get_assign_startdate(2)}</style.MyAssignTitleBoxText> | ||
| </div> | ||
| </style.MyAssignTitleBox> | ||
|
|
||
| <HorizontalLine height={1}></HorizontalLine> | ||
|
|
||
| <style.MyAssignTitleBox height={254} style={{ | ||
| justifyContent:"flex-start", }}> | ||
| <style.MyAssignTitleBoxText color={COLORS.grayscale.Black} | ||
| fontSize={TEXT_STYLES.HeadM18.fontSize+5} fontFamily={TEXT_STYLES.HeadM18.fontFamily} | ||
| fontWeight={TEXT_STYLES.HeadM18.fontWeight} letterSpacing={TEXT_STYLES.HeadM18.letterSpacing} | ||
| style={{marginTop:"5px"}}> {formData.subject.get_assign_information(2)} | ||
| </style.MyAssignTitleBoxText> | ||
| </style.MyAssignTitleBox> | ||
|
|
||
| <HorizontalLine height={1}></HorizontalLine> | ||
|
|
||
|
|
||
| <style.MyAssignTitleBox height={43} style={{ | ||
| justifyContent:"flex-start", }}> | ||
| <div style={{height:"5px"}}></div> | ||
| <div style={{ width:"150px" ,display: "flex", | ||
| justifyContent: "space-between", alignItems: "center"}}> | ||
| <img src="/assets/icon/Icon24/AttachedFile.svg" style={{marginTop:"2px", | ||
| alignSelf: "flex-start", | ||
| width: "20px", marginRight:"4px"}}/> | ||
| <style.MyAssignTitleBoxText color={COLORS.grayscale.Black} | ||
| fontSize={TEXT_STYLES.HeadM18.fontSize+3} fontFamily={TEXT_STYLES.HeadM18.fontFamily} | ||
| fontWeight={TEXT_STYLES.HeadM18.fontWeight} letterSpacing={TEXT_STYLES.HeadM18.letterSpacing} | ||
| style={{width:"150px", marginTop:"0px" }} >첨부파일 | ||
| </style.MyAssignTitleBoxText> | ||
| </div> | ||
| </style.MyAssignTitleBox> | ||
|
|
||
| <AnnouncemeDownLoadFile title="첨부파일" file_link="dd" color={COLORS.grayscale.Black}></AnnouncemeDownLoadFile> | ||
| </div> | ||
| ); | ||
| } | ||
| export default MypageAssignList; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저희 emotion/styled 사용합니다
styled-components 는 삭제해주세요!