Skip to content

Commit 932b58a

Browse files
committed
chore: change the default state of activePage
1 parent eb0c9e2 commit 932b58a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/components/ToolHeader/ToolHeader.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ const SettingsModal = dynamic(() => import('@components/SettingsModal'), {
4646
ssr: false,
4747
});
4848

49-
type ActivePage = 'uxcore' | 'uxcg' | 'uxcp' | 'uxcat' | null;
50-
5149
type TToolHeader = {
5250
homepageLinkTarget?: '_blank' | '_self';
5351
openPodcast?: boolean;
@@ -100,7 +98,7 @@ const ToolHeader: FC<TToolHeader> = ({
10098
const [token, setToken] = useState<string | null>(null);
10199
const [usernameIsTakenError, setUsernameIsTakenError] = useState('');
102100
const [changedTitle, setChangedTitle] = useState(false);
103-
const [activePage, setActivePage] = useState<ActivePage>(null);
101+
const [activePage, setActivePage] = useState<string>(router.asPath);
104102

105103
const {
106104
ourProjects,
@@ -145,7 +143,7 @@ const ToolHeader: FC<TToolHeader> = ({
145143
const title = changedTitle ? userInfo?.title : userInfo?.user?.title;
146144
const normalizePath = (p: string) => p.replace(/\/+$/, '') || '/';
147145

148-
const getActiveFromPath = (pathname: string): ActivePage => {
146+
const getActiveFromPath = (pathname: string) => {
149147
const path = normalizePath(pathname);
150148

151149
const pathWithBypass = /^\/uxcp$/i.test(path) ? '/uxcp/' : path;

0 commit comments

Comments
 (0)