Skip to content

Commit

Permalink
Merge pull request #6 from TEAM-CLIP/2-ui
Browse files Browse the repository at this point in the history
feat: UI 구현 (#2)
  • Loading branch information
NeoSelf1 authored Aug 22, 2024
2 parents 70ef214 + 47e8f57 commit d2d48fa
Show file tree
Hide file tree
Showing 25 changed files with 544 additions and 119 deletions.
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
domains: ['picsum.photos'], // 허용할 외부 이미지 도메인 추가
},
};

export default nextConfig;
5 changes: 4 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@apply font-semibold text-[34px] leading-[42px] tracking-[0px];
}
.title-1 {
@apply font-bold text-[20px] leading-[32px] tracking-[-1.5px];
@apply font-bold text-[20px] leading-[32px] tracking-[0px];
}
.title-2 {
@apply font-semibold text-[18px] leading-[28px] tracking-[0.1px];
Expand Down Expand Up @@ -36,4 +36,7 @@
.btn-selected {
@apply btn bg-gray-800 text-white;
}
.placeholder-gray-300::placeholder {
color: #c1cbd8;
}
}
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function RootLayout({
return (
<html lang="ko">
<body className={`${pretendard.className} bg-gray-50`}>
<Header />
<div className="max-w-md mx-auto bg-white min-h-screen flex flex-col">
<Header />
<main className="flex-grow overflow-y-auto">{children}</main>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Image from 'next/image';
import Link from 'next/link';
import BackgroundImage from '../data/unsplash.png';
import BackgroundImage from '@/data/unsplash.png';

const Home = () => {
return (
Expand Down
119 changes: 86 additions & 33 deletions src/app/photographer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,106 @@
import React from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { useSearchParams } from 'next/navigation';
import { useRouter, useSearchParams } from 'next/navigation';
import { photographers_mu } from '@/data/database';
import ArrowBack from '@/data/arrowLeft.svg';

const RecommendedPhotographers = () => {
const router = useRouter();
const backFunction = () => {
router.back();
};
const searchParams = useSearchParams();
const type = searchParams.get('type');
const price = searchParams.get('price');
const moods = searchParams.get('moods');

//type, price, moods 정보로 작가 추리는 로직 여기서 구현하고 바로 띄우면 될듯.

// 배열을 랜덤하게 섞고 처음 3명의 작가만 선택
const selectedPhotographers = [...photographers_mu]
.sort(() => Math.random() - 0.5)
.slice(0, 3);

return (
<div className="flex flex-col p-4">
<h1 className="text-xl font-bold mb-4">
칙스냅에서 추천드리는 작가에요!
</h1>
<div className="grid grid-cols-2 gap-4">
{photographers_mu.map((photographer) => (
<Link
<div className="relative flex flex-col mx-[1rem] mt-[3.5rem] lg:h-screen md:h-screen sm:h-screen">
<div className="cursor-pointer" onClick={backFunction}>
<div className="flex w-[1.5rem] h-[1.5rem] my-[0.75rem]">
<Image src={ArrowBack} alt="Back" objectFit="cover" />
</div>
</div>
<h2 className="title-1 mt-[0.62rem] mb-[0.25rem]">
칙스냅에서 추천드리는 작가예요!
</h2>
<h3 className="body-3 text-gray-500 mb-[1.75rem]">
아래 작가분들은 여러분의 선택을 기반으로 칙스냅에서 추천드리는
작가님이에요. 자세히 보기를 통해 작가님의 정보를 확인하고 그리던 사진을
촬영해요
</h3>
<div className="flex flex-col gap-[0.62rem]">
{selectedPhotographers.map((photographer) => (
<div
key={photographer.id}
href={`/photographer/${photographer.id}`}
className="flex flex-col"
className="flex flex-col w-full bg-gray-50 p-[0.75rem] rounded-[0.5rem]"
>
<div className="relative aspect-square w-full mb-2 overflow-hidden rounded-lg">
<Image
src={photographer.profileImg}
alt={photographer.name}
layout="fill"
objectFit="cover"
className="rounded-lg transition-transform duration-300 ease-in-out hover:scale-110"
/>
</div>
<p className="body-3">{photographer.name}</p>
<p className="caption text-gray-500">{photographer.instagramId}</p>
</Link>
<a href={`https://www.instagram.com/${photographer.instagramId}/`}>
<div className="flex w-full mb-[1rem] rounded-[0.25rem]">
<div className="flex relative w-[3.38rem] h-[3.38rem] mr-[0.62rem]">
<Image
src={photographer.profileImg}
alt={photographer.name}
width={54}
height={54}
objectFit="cover"
className="rounded-lg transition-transform duration-300 ease-in-out hover:scale-110"
/>
</div>
<div className="flex flex-col w-full justify-center gap-[0.37rem]">
<div className="flex items-center gap-[0.5rem]">
<span className="body-1 text-gray-900">
{photographer.name}
</span>
<span className="caption text-gray-600">
{`@${photographer.instagramId}`}
</span>
</div>
<div className="flex items-center gap-[0.5rem]">
<div className="caption px-[0.5rem] py-[0.25rem] bg-gray-200 rounded-[0.25rem]">
{photographer.price}
</div>
{photographer.services.map((value, index) => (
<div
key={index}
className="caption px-[0.5rem] py-[0.25rem] bg-white rounded-[0.25rem]"
>
{value}
</div>
))}
</div>
</div>
</div>
<div className="flex gap-[0.5rem]">
{photographer.workImages.map((value, index) => (
<div key={index} className="relative w-1/3 h-[8.5rem]">
<Image
src={value}
alt="example image"
layout="fill"
objectFit="cover"
className="rounded-[0.25rem]"
/>
</div>
))}
</div>
</a>
</div>
))}
</div>
<div className="flex space-x-2">
<Link href="/ask" className="w-24">
<button className="btn-default w-full text-[#1F2127] py-3 rounded-lg mt-6">
문의
</button>
</Link>
<Link href="/more-photographers" className="flex-grow">
<button className="btn-primary w-full bg-gray-800 text-white py-3 rounded-lg mt-6">
마음에 드는 작가가 없으시다면?
</button>
<div className="flex">
<Link
href={'/request-custom'}
className={'btn-default body-3 mt-[2rem] mb-[1rem]'}
>
맞춤형 작가 요청하기
</Link>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/app/request-custom/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const Loading = () => {
return (
<div className="flex justify-center items-center h-screen">
<div className="animate-spin rounded-full h-32 w-32 border-t-2 border-b-2 border-gray-900"></div>
</div>
);
};

export default Loading;
100 changes: 100 additions & 0 deletions src/app/request-custom/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
'use client';

import { ChangeEvent, useState } from 'react';
import Link from 'next/link';
import Image from 'next/image';
import ArrowBack from '@/data/arrowLeft.svg';
import { useRouter } from 'next/navigation';

const RequestCustom = () => {
const router = useRouter();
const backFunction = () => {
router.back();
};

const [text, setText] = useState<string>('');

const handleTextChange = (e: ChangeEvent<HTMLTextAreaElement>) => {
setText(e.target.value);
};

const isOverLimit = text.length > 600;
const isTextEntered = text.length > 0;

return (
<div className="relative flex flex-col mx-[1rem] mt-[3.5rem] lg:h-screen md:h-screen sm:h-screen">
<div className="cursor-pointer" onClick={backFunction}>
<div className="flex w-[1.5rem] h-[1.5rem] my-[0.75rem]">
<Image src={ArrowBack} alt="Back" objectFit="cover" />
</div>
</div>
<h2 className="title-1 mt-[0.62rem] mb-[0.25rem]">
맞춤형 작가 요청하기
</h2>
<h3 className="body-3 text-gray-500 mb-[1.75rem]">
칙스냅에서 회원님에게 최적화된 작가분들을 찾아 추천해드릴게요. 약 1~3일
정도 소요될 수 있어요.
</h3>
<div className="flex flex-col gap-[0.5rem]">
<div className="flex justify-between">
<h2 className="body-1">전화번호</h2>
<h2 className="body-3 text-gray-500">*필수</h2>
</div>
<div className="mb-[1.75rem]">
<input
type="text"
placeholder="XXX - XXXX - XXXX"
className="w-full h-[3.125rem] px-[0.875rem] bg-gray-50 rounded-lg body-1 placeholder-gray-300
hover:bg-gray-100 focus:bg-gray-100 focus:border-gray-200 focus:ring-0 focus:outline-none
border border-transparent transition-colors duration-200
not-placeholder-shown:bg-gray-50"
/>
</div>
</div>
<div className="flex flex-col gap-[0.5rem]">
<h2 className="body-1">희망하는 작가님 스타일 (분위기, 종류 등)</h2>
<div className="mb-[1.75rem]">
<textarea
placeholder="예) 따뜻한 분위기의 숲속에서 찍는 스타일, "
className={`flex w-full min-h-[13rem] p-[0.875rem] rounded-lg body-3 placeholder-gray-300 resize-none
${
isOverLimit
? 'border-red-100 focus:outline-red-100'
: 'border-gray-200'
}
${isTextEntered ? 'bg-gray-100' : 'bg-gray-50'}
transition-colors duration-200
hover:bg-gray-100 focus:outline-none focus:outline-1 focus:outline-gray-200`}
style={{ outlineOffset: '0px' }}
value={text}
onChange={handleTextChange}
/>
<div className="flex justify-end">
<p
className={`caption text-gray-600 mt-[0.38rem] ${
isOverLimit ? 'text-red-100' : 'text-gray-600'
}`}
>
최대 600자
</p>
</div>
</div>
</div>
<div className="flex">
<Link
href={'/'}
// href={{
// pathname: '/photographer',
// query: { type, moods: selectedMoods.join(',') },
// }}
// aria-disabled={selectedMoods.length !== 3}
className={'btn-primary body-3 mb-[1rem]'}
>
요청하기
</Link>
</div>
</div>
);
};

export default RequestCustom;
61 changes: 61 additions & 0 deletions src/app/request-notification/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use client';

import { ChangeEvent, useState } from 'react';
import Link from 'next/link';
import Image from 'next/image';
import Close from '@/data/close.svg';
import Instagram from '@/data/instagram.svg';

const RequestNotification = () => {
return (
<div className="relative flex flex-col mx-[1rem] pt-[3.5rem] h-screen">
<Link href={'/'} className="flex justify-end cursor-pointer">
<div className="flex w-[1.5rem] h-[1.5rem] my-[0.75rem]">
<Image src={Close} alt="Back" objectFit="cover" />
</div>
</Link>
<h2 className="title-1 mt-[0.62rem] mb-[0.25rem]">
칙스냅이 오픈되면, 알려드릴게요!
</h2>
<h3 className="body-3 text-gray-500 mb-[1.75rem]">
안녕하세요, 순간을 Chik다 chiksnap입니다.
<br />
Chiksnap은 스냅사진작가를 추천해주는 플랫폼으로 10월 출시 예정에
있습니다.
<br />
오픈 연락을 희망하신다면 아래 연락처를 남겨주세요!
</h3>
<div className="flex flex-col gap-[0.5rem]">
<div className="flex justify-between">
<h2 className="body-1">전화번호</h2>
<h2 className="body-3 text-gray-500">*필수</h2>
</div>
<div className="mb-[1.75rem]">
<input
type="text"
placeholder="XXX - XXXX - XXXX"
className="w-full h-[3.125rem] px-[0.875rem] bg-gray-50 rounded-lg body-1 placeholder-gray-300
hover:bg-gray-100 focus:bg-gray-100 focus:border-gray-200 focus:ring-0 focus:outline-none
border border-transparent transition-colors duration-200
not-placeholder-shown:bg-gray-50"
/>
</div>
</div>
<div className="flex space-x-2 absolute bottom-[1rem] w-full">
<a href={`https://www.instagram.com/chik_snap/`} className="w-1/2">
<button className="btn-default flex justify-center items-center w-full body-3 rounded-lg gap-[0.25rem]">
<div className="flex w-[1.5rem] h-[1.5rem]">
<Image src={Instagram} alt="Back" objectFit="cover" />
</div>
칙스냅에 문의하기
</button>
</a>
<Link href="/" className="flex-grow">
<button className="btn-primary w-full body-3">신청하기</button>
</Link>
</div>
</div>
);
};

export default RequestNotification;
Loading

0 comments on commit d2d48fa

Please sign in to comment.