Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore : 설정 변경 #396

Merged
merged 10 commits into from
Dec 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ export const PostLetterCotainer = () => {

const { addToast } = useToastStore();

const [title, setTitle] = useState<string>(
storedTitle || '제목을 입력해주세요'
);
const [title, setTitle] = useState<string>(storedTitle || '');
const [letter, setLetter] = useState<string>(storedLetter || '1');
const [letterContent, setLetterContent] = useState<string>(
storedContent || '내용을 입력해주세요'
storedContent || ''
);
const [font, setFont] = useState<string>(storedFont || 'initial');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const CreateMapLetterCotainer = () => {

// 위도와 경도를 로컬 스토리지에 저장
localStorage.setItem('maplat', lat?.slice(1) || '');
localStorage.setItem('maplot', lat?.slice(1) || '');
localStorage.setItem('maplot', lot?.slice(1) || '');

// 상태 관리
const [title, setTitle] = useState<string>(storedTitle || '');
Expand Down
19 changes: 8 additions & 11 deletions src/pages/Map/MapExplorerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { useSearchStore } from '@/stores/useSearchStore';
import { formatDate } from '@/util/formatDate';
import { calculateDaysLeft } from '@/util/calculateDaysLeft';
import { formatDistance } from '@/util/formatDistance';
import { BackButtonCotainer } from '@/components/Common/BackButtonContainer/BackButtonCotainer';

export const MapExplorerPage = () => {
const { searchedLocation } = useSearchStore();
Expand Down Expand Up @@ -52,8 +51,6 @@ export const MapExplorerPage = () => {
setQuery(event.target.value);
};

const CreateBtnStyle = `text-sample-blue absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-[5rem] translate-y-7 left-[46%] bg-white border border-sample-blue w-52 rounded-2xl`;

return (
<div>
<div className="relative">
Expand All @@ -72,30 +69,30 @@ export const MapExplorerPage = () => {
/>
{error && <p>검색 오류: {error.message}</p>}
{!isLoading && !error && data?.length === 0 && (
<p className="flex-center mt-40">
<p className="mt-40 flex-center">
검색 결과가 없습니다.
</p>
)}
</div>
)}
</div>
<div className="absolute transform -translate-x-1/2 bottom-[6rem] left-1/2">
<div className="absolute transform -translate-x-1/2 bottom-20 left-1/2">
{!isSearchFocused && (
<>
{selectedLetter ? (
<>
{searchedLocation ? (
<NavLink
to={'/letter/create'}
className={CreateBtnStyle}
to={`/letter/map/:${searchedLocation.lat}/:${searchedLocation.lon}/create`}
className="absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-60 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
>
<HiOutlinePencilAlt />
지도 편지 작성하기
</NavLink>
) : (
<NavLink
to={'/letter/create'}
className={CreateBtnStyle}
className="absolute gap-2 p-2 transform -translate-x-12 cursor-not-allowed flex-center bottom-60 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
onClick={(e) => e.preventDefault()}
>
<HiOutlinePencilAlt />
Expand All @@ -117,16 +114,16 @@ export const MapExplorerPage = () => {
<>
{searchedLocation ? (
<NavLink
to={'/letter/create'}
className={CreateBtnStyle}
to={`/letter/map/:${searchedLocation.lat}/:${searchedLocation.lon}/create`}
className="absolute gap-2 p-2 transform -translate-x-12 flex-center bottom-24 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
>
<HiOutlinePencilAlt />
지도 편지 작성하기
</NavLink>
) : (
<NavLink
to={'/letter/create'}
className={CreateBtnStyle}
className="absolute gap-2 p-2 transform -translate-x-12 cursor-not-allowed flex-center bottom-24 translate-y-7 left-1/2 btn-base w-52 rounded-2xl"
onClick={(e) => e.preventDefault()}
>
<HiOutlinePencilAlt />
Expand Down
Loading