Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ dist-ssr

# docker
.pnpm-store
.initialized
5 changes: 3 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/file-delivery/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

cd /app

if [ -f "package.json" ]; then
if [ -f ".initialized" ]; then
exit 0
fi

mv /defaults/* .
cp -a /defaults/. .
touch .initialized
7 changes: 1 addition & 6 deletions src/app/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RootLayout } from "@/layouts/RootLayout";
import { LocalAuthLayout } from "@/layouts/LocalAuthLayout";
import { ServerAuthLayout } from "@/layouts/ServerAuthLayout";

import { HomePage } from "@/pages/home";
import { RecommendationPage } from "@/pages/recommendation";
import { UserRecommendationsPage } from "@/pages/user-recommendations";
import { OnboardingPage } from "@/pages/onboarding";
Expand All @@ -26,10 +25,6 @@ export const router = createBrowserRouter([
path: "",
element: <RootLayout/>,
children: [
{
path: ROUTES.HOME,
element: <HomePage/>
},
{
path: ROUTES.SIGN_IN,
element: <SignPage mode="sign-in"/>
Expand All @@ -55,7 +50,7 @@ export const router = createBrowserRouter([
element: <RecommendationPage/>
},
{
path: ROUTES.USER_RECOMMENDATIONS,
path: ROUTES.HOME,
element: <UserRecommendationsPage/>
},
{
Expand Down
19 changes: 11 additions & 8 deletions src/components/header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useNavigate } from "react-router";
import { useNavigate, useLocation } from "react-router";
import { ArrowLeftIcon } from "lucide-react";

import { cn } from "@/lib/utils";
Expand All @@ -23,6 +23,7 @@ export function Header({
...props
}: HeaderProps) {
const navigate = useNavigate();
const { pathname } = useLocation();

const handleBack: React.MouseEventHandler<HTMLButtonElement> = () => {
const historyIndex = window.history.state?.idx;
Expand All @@ -41,13 +42,15 @@ export function Header({
{...props}
>
<div className={cn("app-container flex items-center overflow-hidden h-16", className)}>
<Button
type="button"
variant="ghost"
aria-label="뒤로 가기"
onClick={handleBack}
children={<ArrowLeftIcon strokeWidth={3}/>}
/>
{pathname !== "/" && (
<Button
type="button"
variant="ghost"
aria-label="뒤로 가기"
onClick={handleBack}
children={<ArrowLeftIcon strokeWidth={3}/>}
/>
)}
<h1
className="flex-1 font-bold text-lg"
children={heading}
Expand Down
36 changes: 36 additions & 0 deletions src/components/school-district-box.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { cn } from "@/lib/utils";
import type * as schema from "@/shared/schema";



export interface SchoolDistrictBoxProps extends React.ComponentProps<"button"> {
item: schema.SchoolDistrictTypeItem;
isSelected?: boolean;
}


export function SchoolDistrictBox({
item,
className,
isSelected,
...props
}: SchoolDistrictBoxProps) {
return (
<button
type="button"
className={cn(
"flex flex-col items-center-safe justify-center-safe p-3 rounded-xl border text-center transition-all shadow-sm",
isSelected
? "bg-primary text-primary-foreground border-primary font-semibold"
: "bg-transparent hover:bg-accent border-input text-foreground",
className,
)}
{...props}
>
<span className="text-sm">{item.label}</span>
<span className={cn("text-[10px] mt-1 opacity-80", isSelected ? "text-primary-foreground/80" : "text-muted-foreground")}>
{item.description}
</span>
</button>
);
}
14 changes: 14 additions & 0 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ export async function createRecommendation(data: schema.RecommendationCreateInpu
});
}

/**
* 추천 정보 수정 요청
*/
export async function updateRecommendation(taskId: string, data: schema.RecommendationUpdateInput) {
return request({
guard: {
request: schema.recommendationUpdateInput,
},
method: "PATCH",
url: `/recommendations/${taskId}`,
data,
});
}

/**
* 추천 생성 결과 조회
*/
Expand Down
13 changes: 11 additions & 2 deletions src/lib/price-unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,18 @@ export function convertToNumber(value: string) {
* @returns 숫자 가격과 단위 문자열의 튜플 (예: [20, "억 원"], [500, "만 원"])
*/
export function formatPriceUnit(value: number): [number, PriceUnit] {
let number: number;
let unit: PriceUnit;

if (value >= 10_000 * 10_000) {
return [value / (10_000 * 10_000), "억 원"];
number = value / (10_000 * 10_000);
unit = "억 원";
} else {
return [value / 10_000, "만 원"];
number = value / 10_000;
unit = "만 원";
}

number = Math.round(number * 100) / 100; // 소수점 둘째 자리까지 반올림

return [number, unit];
}
49 changes: 0 additions & 49 deletions src/pages/home.tsx

This file was deleted.

Loading
Loading