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
7 changes: 0 additions & 7 deletions src/shared/stores/useDocStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import type { TabKey } from '@/shared/types/tab'
const PATHNAME_TAB_MAP: Array<{ matcher: RegExp; tab: TabKey }> = [
{ matcher: /(^|\/)home(\/|$)/, tab: 'home' },
{ matcher: /(^|\/)my(\/|$)/, tab: 'my' },
{ matcher: /^\/manager\/social(?:\/|$)/, tab: 'message' },
{ matcher: /(^|\/)message(\/|$)/, tab: 'message' },
{ matcher: /(^|\/)repute(\/|$)/, tab: 'repute' },
{ matcher: /(^|\/)search(\/|$)/, tab: 'search' },
{ matcher: /^\/manager\/home/, tab: 'home' },
{ matcher: /^\/user\/job-lookup-map/, tab: 'search' },
Expand All @@ -15,17 +12,13 @@ const PATHNAME_TAB_MAP: Array<{ matcher: RegExp; tab: TabKey }> = [
const createSelectedTab = (activeTab?: TabKey) => ({
home: activeTab === 'home',
my: activeTab === 'my',
message: activeTab === 'message',
repute: activeTab === 'repute',
search: activeTab === 'search',
})

interface DocStoreState {
selectedTab: {
home: boolean
my: boolean
message: boolean
repute: boolean
search: boolean
}
setSelectedTab: (selectedTab: DocStoreState['selectedTab']) => void
Expand Down
4 changes: 1 addition & 3 deletions src/shared/types/tab.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export type TabKey = 'home' | 'my' | 'message' | 'repute' | 'search'
export type TabKey = 'home' | 'my' | 'search'

export const TAB_TITLE_MAP: Record<TabKey, string> = {
home: '홈',
my: 'MY',
message: '소셜',
repute: '평판',
search: '알바 찾기',
}
18 changes: 0 additions & 18 deletions src/shared/ui/common/Docbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import HomeIcon from '@/assets/icons/doc/Home.svg?react'
import MYIcon from '@/assets/icons/doc/MY.svg?react'
import MessageIcon from '@/assets/icons/doc/Message.svg?react'
import ReputeIcon from '@/assets/icons/doc/Repute.svg?react'
import SearchIcon from '@/assets/icons/doc/Search.svg?react'
import type { ComponentType, SVGProps } from 'react'
import { useEffect } from 'react'
Expand Down Expand Up @@ -76,20 +74,6 @@ export function DocbarView({ selectedTab, onTabClick }: DocbarViewProps) {
titleKey="search"
onClick={() => onTabClick('search')}
/>
<DocContent
icon={MessageIcon}
alt="Message"
isSelected={selectedTab.message}
titleKey="message"
onClick={() => onTabClick('message')}
/>
<DocContent
icon={ReputeIcon}
alt="Repute"
isSelected={selectedTab.repute}
titleKey="repute"
onClick={() => onTabClick('repute')}
/>
<DocContent
icon={MYIcon}
alt="MY"
Expand Down Expand Up @@ -118,8 +102,6 @@ export function Docbar() {
const pathByTab: Record<TabKey, string> = {
home: scope === 'MANAGER' ? '/manager/home' : '/user/home',
search: '/user/job-lookup-map',
message: scope === 'MANAGER' ? '/manager/social' : '/user/message',
repute: '/repute',
my: '/my',
}

Expand Down
9 changes: 0 additions & 9 deletions storybook/stories/Docbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type { TabKey } from '../../src/shared/types/tab'
const createSelectedTab = (activeTab: TabKey): DocbarSelectedTab => ({
home: activeTab === 'home',
my: activeTab === 'my',
message: activeTab === 'message',
repute: activeTab === 'repute',
search: activeTab === 'search',
})

Expand Down Expand Up @@ -36,10 +34,3 @@ export const SearchSelected: Story = {
onTabClick: () => {},
},
}

export const MessageSelected: Story = {
args: {
selectedTab: createSelectedTab('message'),
onTabClick: () => {},
},
}
Loading