Skip to content

Commit

Permalink
[style] Develop loading, eventcreate page (#57)
Browse files Browse the repository at this point in the history
* Refactor: ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง ๋ฐ ์Šคํƒ€์ผ ์ •๋ฆฌ

* [style] page.tsx and eventcreate-page components
  • Loading branch information
karnelll authored Nov 5, 2024
1 parent 8c0fba7 commit 4f91fd9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 49 deletions.
18 changes: 4 additions & 14 deletions fe/src/app/eventcreate-page/components/EventNameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,21 @@ import React, { useEffect, useState, useCallback } from "react";
import Image from "next/image";
import { EventNameInputProps } from "@/app/eventcreate-page/types/types";

const getCurrentDate = () => {
const today = new Date();
const month = String(today.getMonth() + 1).padStart(2, "0");
const day = String(today.getDate()).padStart(2, "0");
return `${month}.${day}`;
};

function EventNameInput({
className,
selectedLocation,
onChange,
value,
}: EventNameInputProps) {
const [hasUserEdited, setHasUserEdited] = useState(false);
const currentDate = getCurrentDate();
const showWarning = hasUserEdited && value.trim().length < 1;

useEffect(() => {
if (!hasUserEdited) {
const newEventName = selectedLocation
? `${currentDate} ${selectedLocation} ๋ชจ์ž„`
: "";
const newEventName = selectedLocation ? `${selectedLocation} ๋ชจ์ž„` : "";
onChange(newEventName);
}
}, [selectedLocation, currentDate, onChange, hasUserEdited]);
}, [selectedLocation, onChange, hasUserEdited]);

const handleInputChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -44,7 +34,7 @@ function EventNameInput({
return (
<div className={`relative flex flex-col mt-4 ${className}`}>
<label className="text-[#2c2c2c] text-lg font-semibold leading-relaxed mb-2">
์ด๋ฒคํŠธ ์ด๋ฆ„
์šฐ๋ฆฌ์˜ ๋ชจ์ž„ ์ด๋ฆ„์€?
</label>

<div
Expand All @@ -56,7 +46,7 @@ function EventNameInput({
type="text"
value={value}
onChange={handleInputChange}
placeholder={`${currentDate} ๋ชจ์ž„`}
placeholder="๋ชจ์ž„"
className="bg-transparent text-[#2c2c2c] text-base font-medium outline-none flex-grow"
aria-label="์ด๋ฒคํŠธ ์ด๋ฆ„ ์ž…๋ ฅ"
/>
Expand Down
4 changes: 2 additions & 2 deletions fe/src/app/eventcreate-page/components/LocationInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import Image from "next/image";
import { useLocationStore } from "@/app/eventcreate-page/stores/useLocationStore";
import { LocationInputProps } from "@/app/eventcreate-page/types/types"; // 'Place'๋ฅผ ์‚ญ์ œ
import { LocationInputProps } from "@/app/eventcreate-page/types/types";

function LocationInput({
className,
Expand All @@ -25,7 +25,7 @@ function LocationInput({
return (
<div className={`relative flex flex-col ${className} mt-4`}>
<label className="text-[#2c2c2c] text-xl font-semibold font-['Pretendard'] leading-loose mb-4">
์–ด๋–ค ๊ณต๊ฐ„์„ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”?
์–ด๋””์„œ ๋ชจ์—ฌ์š”?
</label>
<button
type="button"
Expand Down
16 changes: 8 additions & 8 deletions fe/src/app/eventcreate-page/types/types.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export interface Place {
id?: string;
name: string;
address: string;
px?: number;
py?: number;
}

export interface EventNameInputProps {
value: string;
onChange: (name: string) => void;
Expand All @@ -13,14 +21,6 @@ export interface LocationState {
moveToLocation: (latitude: number, longitude: number) => void;
}

export interface Place {
id?: string;
name: string;
address: string;
px?: number;
py?: number;
}

export interface LocationInputProps {
className?: string;
value: string;
Expand Down
47 changes: 22 additions & 25 deletions fe/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,37 @@ function LoadingPage() {
};

return (
<div className="bg-primary-50 h-screen w-full flex flex-col items-center relative">
<div className="w-full sticky top-0 z-10 flex justify-center bg-primary-50">
<div className="w-full h-[89px] flex justify-center">
<div className="w-full h-screen bg-[#1d1d1d] flex flex-col items-center relative">
{/* ์ค‘์•™ ๋กœ๊ณ  */}
<div className="flex flex-col items-center absolute inset-x-0 top-[152px]">
<Image
src="/images/mopinglogo.svg"
alt="Moping Logo"
width={150}
height={169}
className="object-cover"
priority
/>

{/* MOPING ํ…์ŠคํŠธ */}
<div className="mt-[27px]">
<Image
src="/images/loadinglogo.svg"
alt="MMMM Logo"
width={623}
height={89}
className="object-cover w-full h-full"
priority
src="/images/MOPING.svg" // MOPING ํ…์ŠคํŠธ ์ด๋ฏธ์ง€
alt="Moping Text"
width={193}
height={27}
className="object-cover"
/>
</div>
</div>
<div className="flex flex-col items-center absolute inset-x-0 top-[327px] text-center">
<h1 className="text-text-default text-[62px] leading-[62px] font-black font-pretendard text-shadow-lg">
MOPING
</h1>
<div className="w-full mt-2">
<p className="text-grayscale-0 text-xl font-black font-pretendard">
MIX
<span className="text-text-default"> OUR PINS,</span>
<br />
SHARE
<span className="text-text-default"> OUR PLACES</span>
</p>
</div>
</div>

{/* ์‹œ์ž‘ํ•˜๊ธฐ ๋ฒ„ํŠผ */}
<div className="fixed bottom-[45px] w-full flex justify-center px-4">
<Button
label="์‹œ์ž‘ํ•˜๊ธฐ"
label="๋ชจํ•‘ ์‹œ์ž‘ํ•˜๊ธฐ"
onClick={handleStartClick}
type="start"
className="w-full max-w-[328px] h-[60px] py-[17px] rounded-lg bg-darkGray text-grayscale-0"
className="w-full max-w-[328px] h-[60px] py-[17px] rounded-lg bg-[#F73A2C] text-white"
/>
</div>
</div>
Expand Down

0 comments on commit 4f91fd9

Please sign in to comment.