Skip to content

Commit

Permalink
Merge pull request #17 from TEAM-Hearus/feat/my-script
Browse files Browse the repository at this point in the history
Feat : ๋‚ด ์Šคํฌ๋ฆฝํŠธ ํŽ˜์ด์ง€ ์ถ”๊ฐ€
  • Loading branch information
Nangniya authored Jul 13, 2024
2 parents b22c8cd + ad234ec commit fe59782
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 1 deletion.
39 changes: 39 additions & 0 deletions src/components/common/ScriptItem/ScriptItem.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import '../../../styles/variables/colors.scss';
@import '../../../styles/variables/fonts.scss';

.postItContainer {
display: flex;
flex-direction: column;
background-color: $white_FF;
width: 240px;
height: 300px;
border-radius: 8px;
box-shadow: 0px 3px 4px 0px $box-shadow_00;
padding: 10px;
margin: 20px;
}
.title {
@include SemiBold_Body_16;
color: $dark-font_33;
padding: 10px 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.content {
@include Regular_Sub_14;
color: $light-gray_81;
height: 200px;
padding: 3px 10px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 9;
-webkit-box-orient: vertical;
line-height: 22px;
}
.date {
@include Medium_Sub_14;
color: $light-gray_81;
padding: 10px;
}
18 changes: 18 additions & 0 deletions src/components/common/ScriptItem/ScriptItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styles from './ScriptItem.module.scss';

interface IScriptProps {
// id: number;
title: string;
content: string;
date: string;
}
const ScriptItem = ({ title, content, date }: IScriptProps) => {
return (
<div className={styles.postItContainer}>
<div className={styles.title}>{title}</div>
<div className={styles.content}>{content}</div>
<span className={styles.date}>{date}</span>
</div>
);
};
export default ScriptItem;
12 changes: 12 additions & 0 deletions src/components/common/buttons/StartBtn/StartBtn.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@import '../../../../styles/variables/colors.scss';
@import '../../../../styles/variables/fonts.scss';

.startingBtn {
border-radius: 26px;
background-color: $brand-point;
cursor: pointer;
border-width: 0;
padding: 12px 24px;
@include Regular_Body_16;
color: $white_FF;
}
9 changes: 9 additions & 0 deletions src/components/common/buttons/StartBtn/StartBtn.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import styles from './StartBtn.module.scss';

interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {}

const StartingButton = (props: ButtonProps) => {
return <button className={styles.startingBtn} {...props} />;
};

export default StartingButton;
51 changes: 51 additions & 0 deletions src/constants/script.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
export interface IScriptElement {
id: number;
title: string;
content: string;
date: string;
}

export const scriptElements: IScriptElement[] = [
{
id: 1,
title: '๊ฒฝ์ œํ•™์›๋ก -240708',
content:
'์ •๋ถ€์™€ ์ค‘์•™์€ํ–‰์ด ๊ฒฝ์ œ๋ฅผ ์–ด๋–ป๊ฒŒ ์กฐ์ ˆํ•˜๊ณ , ๊ฒฝ์ œ ๋ฌธ์ œ์— ๋Œ€์‘ํ•˜๋Š”์ง€๋ฅผ ๋‹ค๋ฃจ๋Š” ๊ฒฝ์ œ ์ •์ฑ…์€ ๋งค์šฐ ์ค‘์š”ํ•œ ์ฃผ์ œ์ž…๋‹ˆ๋‹ค. ํ†ตํ™” ์ •์ฑ…, ์žฌ์ • ์ •์ฑ… ๋“ฑ ๋‹ค์–‘ํ•œ ์ •์ฑ… ๋„๊ตฌ๋ฅผ ํ†ตํ•ด ๊ฒฝ์ œ์˜ ์•ˆ์ •์„ฑ๊ณผ ์„ฑ์žฅ์„ ์œ ์ง€ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค.',
date: '2024.07.08',
},
{
id: 2,
title: '๊ฒฝ์ œํ•™์„ธ๋ฏธ๋‚˜-240705',
content:
'์•ˆ๋…•ํ•˜์„ธ์š”, ์—ฌ๋Ÿฌ๋ถ„. ์˜ค๋Š˜์€ ๊ฒฝ์ œ ์„ธ๊ณ„์—์„œ์˜ ๊ธˆ์œต ์ธก๋ฉด์— ๋Œ€ํ•ด ํ•จ๊ป˜ ์ด์•ผ๊ธฐํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๊ธˆ์œต ์‹œ์žฅ์˜ ๋ณ€ํ™”์™€ ๊ทธ ์˜ํ–ฅ์— ๋Œ€ํ•ด ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ์ตœ๊ทผ ๋ช‡ ๋…„๊ฐ„ ๊ธˆ์œต ์‹œ์žฅ์—์„œ ํฐ ๋ณ€ํ™”๋ฅผ ๊ฒฝํ—˜ํ•ด์™”์Šต๋‹ˆ๋‹ค. ํŠนํžˆ ๋””์ง€ํ„ธ ํ™”ํ์˜ ๋“ฑ์žฅ๊ณผ ๋ธ”๋ก์ฒด์ธ ๊ธฐ์ˆ ์˜ ๋ฐœ์ „์€ ๊ธˆ์œต ์‹œ์žฅ์— ํ˜์‹ ์ ์ธ ๋ณ€ํ™”๋ฅผ ๊ฐ€์ ธ์™”์Šต๋‹ˆ๋‹ค. ์ด์— ๋”ฐ๋ฅธ ๊ธˆ์œต ๊ธฐ๊ด€๋“ค์˜ ์ „๋žต์  ๋Œ€์‘๊ณผ ์‚ฌ์šฉ์ž๋“ค์˜ ๊ธˆ์œต ์„œ๋น„์Šค ์‚ฌ์šฉ ๋ฐฉ์‹์—๋„ ํฐ ๋ณ€ํ™”๊ฐ€ ์ผ์–ด๋‚˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.',
date: '2024.07.05',
},
{
id: 3,
title: '์ฒญ๊ฐ• ๋…ธํŠธ',
content:
'๋Œ€ํ†ต๋ นยท๊ตญ๋ฌด์ด๋ฆฌยท๊ตญ๋ฌด์œ„์›ยทํ–‰์ •๊ฐ๋ถ€์˜ ์žฅยทํ—Œ๋ฒ•์žฌํŒ์†Œ ์žฌํŒ๊ด€ยท๋ฒ•๊ด€ยท์ค‘์•™์„ ๊ฑฐ๊ด€๋ฆฌ์œ„์›ํšŒ ์œ„์›ยท๊ฐ์‚ฌ์›์žฅยท๊ฐ์‚ฌ์œ„์› ๊ธฐํƒ€ ๋ฒ•๋ฅ ์ด ์ •ํ•œ ๊ณต๋ฌด์›์ด ์€ ํ—Œ๋ฒ•์žฌํŒ์†Œ์— ์ œ์ฒญํ•˜์—ฌ ๊ทธ ์‹ฌํŒ์— ์˜ํ•˜์—ฌ ์žฌํŒํ•œ๋‹ค.๋Œ€ํ†ต๋ นยท๊ตญ๋ฌด์ด๋ฆฌยท๊ตญ๋ฌด์œ„์›ยทํ–‰์ •๊ฐ๋ถ€์˜ ์žฅยทํ—Œ๋ฒ•์žฌํŒ์†Œ ์žฌํŒ๊ด€ยท๋ฒ•๊ด€ยท์ค‘์•™์„ ๊ฑฐ๊ด€๋ฆฌ์œ„์›ํšŒ ์œ„์›',
date: '2024.07.04',
},
{
id: 4,
title: '๊ฒฝ์ œ์ˆ˜ํ•™-240703',
content:
'๋Œ€ํ†ต๋ นยท๊ตญ๋ฌด์ด๋ฆฌยท๊ตญ๋ฌด์œ„์›ยทํ–‰์ •๊ฐ๋ถ€์˜ ์žฅยทํ—Œ๋ฒ•์žฌํŒ์†Œ ์žฌํŒ๊ด€ยท๋ฒ•๊ด€ํ•œ ๊ณต๋ฌด์›์ด ๊ทธ ์ง๋ฌด์ง‘ํ–‰์— ์žˆ์–ด์„œ ํ—Œ๋ฒ•์ด๋‚˜ ๋ฒ•๋ฅ ์„ ์œ„๋ฐฐํ•œ ๋•Œ์—๋Š” ๊ตญํšŒ๋Š” ํƒ„ํ•ต์˜ ์†Œ์ถ”๋ฅผ ์˜๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ฒ•๋ฅ ์ด ํ—Œ๋ฒ•์— ์œ„๋ฐ˜๋˜๋Š” ์—ฌ๋ถ€๊ฐ€ ์žฌํŒ์˜ ์ „์ œ๊ฐ€ ๋œ ๊ฒฝ์šฐ์—๋Š”',
date: '2024.07.03',
},
{
id: 5,
title: '์กฐ๋ณ„๊ณผ์ œ ํšŒ์˜',
content:
'์•ˆ๋…•ํ•˜์„ธ์š”, ์ €๋Š” ์กฐ์˜ ๋งˆ์ผ€ํŒ… ํŒŒํŠธ๋ฅผ ๋งก๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ตœ๊ทผ์— ์šฐ๋ฆฌ๊ฐ€ ์„ค์ •ํ•œ ๋งˆ์ผ€ํŒ… ์ „๋žต์— ๋Œ€ํ•ด ๋ช‡ ๊ฐ€์ง€ ์—…๋ฐ์ดํŠธ๋ฅผ ํ•ด ๋“œ๋ฆด๊ฒŒ์š”. ์ด๋ฒˆ ์ฃผ์—๋Š” SNS ์บ ํŽ˜์ธ์„ ํ†ตํ•ด ๋งŽ์€ ๊ด€์‹ฌ์„ ๋Œ์—ˆ๊ณ , ํŠนํžˆ Instagram์—์„œ์˜ ๋ฐ˜์‘์ด ์ข‹์•˜์Šต๋‹ˆ๋‹ค. ์ €๋Š” ์žฌ๋ฌด ๋ถ„์„์„ ๋‹ด๋‹นํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ง€๋‚œ ์ฃผ์—๋Š” ์‹œ์žฅ ์กฐ์‚ฌ์™€ ๊ฒฝ์Ÿ์‚ฌ ๋ถ„์„์„ ๋งˆ์ณค๊ณ , ์ด๋ฒˆ ์ฃผ์—๋Š” ์ˆ˜์น˜ ์ž๋ฃŒ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์„ธ๋ถ€์ ์ธ ์žฌ๋ฌด ๋ชจ๋ธ์„ ์ค€๋น„ ์ค‘์— ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ์‚ฐ ๋ฐ ์ž๊ธˆ ์กฐ๋‹ฌ ๊ณ„ํš๋„ ์กฐ์†ํžˆ ์™„์„ฑํ•  ๊ณ„ํš์ž…๋‹ˆ๋‹ค.',
date: '2024.07.02',
},
{
id: 6,
title: '๊ฒฝ์ œํ•™์›๋ก -240701',
content:
'์•ˆ๋…•ํ•˜์„ธ์š”, ์—ฌ๋Ÿฌ๋ถ„. ๊ฒฝ์ œํ•™ ์›๋ก  ์ˆ˜์—…์„ ์‹œ์ž‘ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฒฝ์ œํ•™์€ ์šฐ๋ฆฌ๊ฐ€ ์ž์›์„ ์–ด๋–ป๊ฒŒ ๋ถ„๋ฐฐํ•˜๊ณ  ์ƒ์‚ฐํ•˜๋ฉฐ ์†Œ๋น„ํ•˜๋Š”์ง€๋ฅผ ์ดํ•ดํ•˜๋Š” ํ•™๋ฌธ์ž…๋‹ˆ๋‹ค. ์ด ์ˆ˜์—…์—์„œ๋Š” ๊ฒฝ์ œํ•™์˜ ๊ธฐ๋ณธ ๊ฐœ๋…๊ณผ ์ฃผ์š” ์ด๋ก ๋“ค์„ ๋ฐฐ์šฐ๊ณ , ์ด๋ฅผ ํ˜„์‹ค ์„ธ๊ณ„์˜ ๊ฒฝ์ œ ํ˜„์ƒ์— ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์šฐ๊ฒŒ ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.',
date: '2024.07.01',
},
];
39 changes: 39 additions & 0 deletions src/pages/Main/MyScript/MyScript.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import '../../../styles/variables/colors.scss';
@import '../../../styles/variables/fonts.scss';

.wholeContainer {
display: flex;
flex-direction: column;
width: 100%;
padding: 30px 40px;
}
.headerContainer {
@include Medium_Title_24;
display: flex;
justify-content: space-between;
align-items: center;
}
.recentScripts {
color: $dark-font_5A;
}

.noneScriptContainer {
display: flex;
justify-content: center;
height: 80%;
align-items: center;
flex-direction: column;
color: $light-font_9E;
}
.noneScript {
@include SemiBold_Body_18;
}
.startingScript {
@include Medium_Sub_14;
}
.scriptContainer {
display: flex;
width: 100%;
height: auto;
flex-wrap: wrap;
}
61 changes: 60 additions & 1 deletion src/pages/Main/MyScript/MyScript.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
import styles from './MyScript.module.scss';
import StartingButton from '../../../components/common/buttons/StartBtn/StartBtn';
import ScriptItem from '../../../components/common/ScriptItem/ScriptItem';
import { scriptElements } from '../../../constants/script';

const MyScript = () => {
return <div>MyScript</div>;
// const { data } = useQuery<IScriptElement[], Error>({
// queryKey: ['script'],
// queryFn: () => getScript(),
// });

return (
<div className={styles.wholeContainer}>
<div className={styles.headerContainer}>
<div className={styles.recentScripts}>
{scriptElements ? '์ตœ๊ทผ ์Šคํฌ๋ฆฝํŠธ' : ''}
</div>
<StartingButton>๋…น์Œ ์‹œ์ž‘</StartingButton>
</div>

{!scriptElements ? (
<div className={styles.noneScriptContainer}>
<h4 className={styles.noneScript}>์Šคํฌ๋ฆฝํŠธ ์—†์Œ</h4>
<br></br>
<p className={styles.startingScript}>
๋…น์Œ ์‹œ์ž‘ ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ ๋งŒ๋“ค์–ด๋ณด์„ธ์š”
</p>
</div>
) : (
<div className={styles.scriptContainer}>
{scriptElements?.map((script) => (
<ScriptItem key={script.id} {...script} />
))}
{/* <ScriptItem
id="1"
title="๊ฒฝ์ œํ•™์›๋ก -240708"
content="์ •๋ถ€์™€ ์ค‘์•™์€ํ–‰์ด ๊ฒฝ์ œ๋ฅผ ์–ด๋–ป๊ฒŒ ์กฐ์ ˆํ•˜๊ณ , ๊ฒฝ์ œ ๋ฌธ์ œ์— ๋Œ€์‘ํ•˜๋Š”์ง€๋ฅผ ๋‹ค๋ฃจ๋Š” ๊ฒฝ์ œ ์ •์ฑ…์€ ๋งค์šฐ ์ค‘์š”ํ•œ ์ฃผ์ œ์ž…๋‹ˆ๋‹ค. ํ†ตํ™” ์ •์ฑ…, ์žฌ์ • ์ •์ฑ… ๋“ฑ ๋‹ค์–‘ํ•œ ์ •์ฑ… ๋„๊ตฌ๋ฅผ ํ†ตํ•ด ๊ฒฝ์ œ์˜ ์•ˆ์ •์„ฑ๊ณผ ์„ฑ์žฅ์„ ์œ ์ง€ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค."
date="2024.05.07"
></ScriptItem>
<ScriptItem
id="1"
title="title"
content="content"
date="date"
></ScriptItem>
<ScriptItem
id="1"
title="title"
content="content"
date="2024.05.07"
></ScriptItem>
<ScriptItem
id="1"
title="title"
content="content"
date="2024.05.07"
></ScriptItem> */}
</div>
)}
</div>
);
};

export default MyScript;
6 changes: 6 additions & 0 deletions src/styles/variables/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ $dark-font_5A: #5a5a5a;
$dark-font_33: #333333;
$dark-orange_E5: #e5592d;

/* White */
$white_FF: #ffffff;

/* Gray */
$light-bg_F9: #f9f9f9;
$light-bg_F2: #f2f2f4;
Expand All @@ -14,3 +17,6 @@ $light-blue_B3: #b3b6c0;
$light-font_9E: #9ea1b0;
$light-bg_89: #898e9d;
$light-gray_81: #818492;

/* shadow */
$box-shadow_00: #0000001a;

0 comments on commit fe59782

Please sign in to comment.