Skip to content

Commit d530df8

Browse files
authored
Merge pull request #20 from Leets-Official/19-feat/Header-컴포넌트-제작
[Feat] Header 컴포넌트 제작
2 parents 7d6f4aa + 1460a2a commit d530df8

16 files changed

Lines changed: 432 additions & 11 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CodeQL
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v3
28+
with:
29+
languages: javascript-typescript
30+
trap-caching: false
31+
32+
- name: Perform CodeQL Analysis
33+
uses: github/codeql-action/analyze@v3

.github/workflows/pr-automation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
// Reviewer 추가
3737
if (currentReviewers.length === 0) {
38-
const reviewers = ['YeBeenChoi', 'jwj0620gcu'].filter(r => r !== prAuthor);
38+
const reviewers = ['YeBeenChoi', 'jwj0620gcu', 'KyeongJooni'].filter(r => r !== prAuthor);
3939
if (reviewers.length > 0) {
4040
try {
4141
await github.rest.pulls.requestReviewers({

.github/workflows/pr-check.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Build Test
1+
name: PR Build Test
22

33
on:
44
pull_request:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
812
permissions:
913
contents: read
1014
pull-requests: write
@@ -54,14 +58,12 @@ jobs:
5458
run: |
5559
yarn lint --max-warnings 0 --format json > lint-results.json || {
5660
echo "LINT_FAILED=true" >> $GITHUB_OUTPUT
57-
echo "Lint issues found, but continuing build..."
61+
exit 1
5862
}
59-
continue-on-error: true
6063
6164
- name: Format check
6265
id: format
6366
run: yarn format:check
64-
continue-on-error: true
6567

6668
- name: Run tests
6769
id: test
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PR Description Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
pull-requests: write
13+
14+
jobs:
15+
check-description:
16+
name: Check PR description
17+
runs-on: ubuntu-latest
18+
if: github.event.pull_request.draft == false
19+
20+
steps:
21+
- name: Check if PR has description
22+
id: check
23+
run: |
24+
# 템플릿 텍스트 제거:
25+
# - 제목 (## 로 시작)
26+
# - HTML 주석 (<!-- -->)
27+
# - 체크리스트 (- [ ])
28+
# - 구분선 (---)
29+
# - 빈 줄
30+
# - "- Close #" 만 있는 줄
31+
FILTERED=$(echo "$RAW_BODY" | sed -r \
32+
-e '/^##/d' \
33+
-e '/<!--.*-->/d' \
34+
-e '/^<!--/d' \
35+
-e '/^-->/d' \
36+
-e '/^---$/d' \
37+
-e '/^- \[/d' \
38+
-e '/^- Close #$/d' \
39+
-e '/^$/d')
40+
41+
if [[ -z "${FILTERED//[[:space:]]/}" ]]; then
42+
echo "empty=true" >> $GITHUB_OUTPUT
43+
else
44+
echo "empty=false" >> $GITHUB_OUTPUT
45+
fi
46+
env:
47+
RAW_BODY: ${{ github.event.pull_request.body }}
48+
49+
- uses: actions/checkout@v4
50+
if: steps.check.outputs.empty == 'true'
51+
with:
52+
sparse-checkout: 'README.md'
53+
54+
- name: Comment on PR
55+
if: steps.check.outputs.empty == 'true'
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
run: |
59+
gh pr comment ${{ github.event.pull_request.number }} --body \
60+
"👋 @${{ github.actor }} PR 설명이 비어있습니다. 변경 사항에 대한 설명을 추가해주세요."

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ node_modules
66
pnpm-lock.yaml
77
yarn.lock
88
package-lock.json
9+
lint-results.json

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"dev": "vite",
99
"build": "tsc -b && vite build",
1010
"lint": "eslint .",
11-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
12-
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
11+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
12+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
1313
"preview": "vite preview",
1414
"test": "vitest",
1515
"test:ui": "vitest --ui",

src/app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function Root() {
2121
<Meta />
2222
<Links />
2323
</head>
24-
<body>
24+
<body className="w-full overflow-x-hidden">
2525
<AppProviders>
2626
<Outlet />
2727
</AppProviders>

src/pages/playground.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Button } from '@shared/ui/Button/Button';
22
import { Card } from '@shared/ui/Card/Card';
33
import { Checkbox } from '@shared/ui/Checkbox/Checkbox';
4+
import { Header } from '@shared/ui/Header/Header';
45
import { Profile } from '@shared/ui/Profile/Profile';
56
import { RadioButton } from '@shared/ui/RadioButton/RadioButton';
67

@@ -10,6 +11,11 @@ export default function Playground() {
1011
<h1 className="typo-title-2">UI Playground</h1>
1112

1213
{/* Button */}
14+
<section className="flex flex-col gap-4">
15+
<h2 className="typo-body-1">Header</h2>
16+
<Header />
17+
</section>
18+
1319
<section className="flex flex-col gap-4">
1420
<h2 className="typo-body-1">Button</h2>
1521
<p className="typo-caption-2 text-gray-600">

src/shared/assets/logo/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Logo from './logo.svg?react';
2+
import Logo2 from './logo2.svg?react';
3+
import Logo3 from './logo3.svg?react';
4+
5+
export { Logo, Logo2, Logo3 };

src/shared/ui/Button/Button.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import type { VariantProps } from 'tailwind-variants';
55
export type ButtonProps = Omit<ComponentPropsWithoutRef<'button'>, 'type'> &
66
VariantProps<typeof buttonVariants>;
77

8-
export const Button = ({ children, variant, className, onMouseUp, ...props }: ButtonProps) => {
8+
export const Button = ({
9+
children,
10+
variant,
11+
size,
12+
className,
13+
onMouseUp,
14+
...props
15+
}: ButtonProps) => {
916
const handleMouseUp = (e: React.MouseEvent<HTMLButtonElement>) => {
1017
onMouseUp?.(e);
1118
e.currentTarget.blur();
@@ -14,7 +21,7 @@ export const Button = ({ children, variant, className, onMouseUp, ...props }: Bu
1421
return (
1522
<button
1623
type="button"
17-
className={buttonVariants({ variant, className })}
24+
className={buttonVariants({ variant, size, className })}
1825
onMouseUp={handleMouseUp}
1926
{...props}
2027
>

0 commit comments

Comments
 (0)