Skip to content

Commit

Permalink
feat: setting page logout
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Feb 15, 2024
1 parent acffb37 commit 8d84f15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/pages/Setting.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useAuth } from '../api/auth';
import Header from './component/Header';
import SettingText from './component/SettingText';

export default function Store() {
const { logout } = useAuth();
return (
<div>
<Header text="설정" back border />
Expand All @@ -16,7 +18,7 @@ export default function Store() {
<SettingText text="서비스이용약관"></SettingText>
<SettingText text="개인정보처리방침"></SettingText>
<SettingText text="버전 정보" border></SettingText>
<SettingText text="로그아웃"></SettingText>
<SettingText text="로그아웃" onClick={logout}></SettingText>
</div>
);
}
11 changes: 7 additions & 4 deletions src/pages/component/SettingText.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import React, { useState } from 'react';
import { Link } from 'react-router-dom';

type SettingTextPrors = {
type SettingTextProps = {
text: string;
nextUrl?: string;
icon?: boolean;
border?: boolean;
onClick?: () => void;
};

const SettingText: React.FC<SettingTextPrors> = ({
const SettingText = ({
text,
nextUrl,
icon,
border,
}) => {
onClick,
}: SettingTextProps) => {
return (
<Link
to={nextUrl ? nextUrl : '#'}
onClick={onClick}
to={nextUrl ?? '#'}
className={`h-[64px] w-full leading-[64px] flex items-center pl-5 ${
border && 'border-b border-gray-300'
}`}
Expand Down

0 comments on commit 8d84f15

Please sign in to comment.