forked from harness/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8274a24
commit 55e6d23
Showing
20 changed files
with
250 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
apps/design-system/src/pages/view-preview/project-settings-wrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/gitness/src/pages-v2/profile-settings/settings-layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Outlet, useLocation } from 'react-router-dom' | ||
|
||
import { ProfileSettingsTabNav } from '@harnessio/ui/views' | ||
|
||
import { useTranslationStore } from '../../i18n/stores/i18n-store' | ||
|
||
export const SettingsLayout = () => { | ||
const location = useLocation() | ||
const activeTab = location.pathname.split('/').pop() || 'general' | ||
|
||
return ( | ||
<> | ||
<div className="bg-background-1 top-14.5 sticky z-40"> | ||
<ProfileSettingsTabNav activeTab={activeTab} useTranslationStore={useTranslationStore} /> | ||
</div> | ||
<Outlet /> | ||
</> | ||
) | ||
} |
16 changes: 16 additions & 0 deletions
16
apps/gitness/src/pages-v2/project/project-settings-layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Outlet } from 'react-router-dom' | ||
|
||
import { ProjectSettingsTabNav } from '@harnessio/ui/views' | ||
|
||
import { useTranslationStore } from '../../i18n/stores/i18n-store' | ||
|
||
export const ProjectSettingsLayout = () => { | ||
return ( | ||
<> | ||
<div className="bg-background-1 top-14.5 sticky z-40"> | ||
<ProjectSettingsTabNav useTranslationStore={useTranslationStore} /> | ||
</div> | ||
<Outlet /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/ui/src/views/profile-settings/profile-settings-tab-nav.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useCallback } from 'react' | ||
import { useNavigate } from 'react-router-dom' | ||
|
||
import { Tabs, TabsList, TabsTrigger } from '@/components' | ||
import { SandboxLayout, TranslationStore } from '@/views' | ||
|
||
function ProfileSettingsTabNav({ | ||
activeTab, | ||
useTranslationStore | ||
}: { | ||
activeTab: string | ||
useTranslationStore: () => TranslationStore | ||
}) { | ||
const { t } = useTranslationStore() | ||
const navigate = useNavigate() | ||
|
||
const makeHandleTabChange = useCallback((tab: string) => () => navigate(tab), [navigate]) | ||
|
||
return ( | ||
<> | ||
<SandboxLayout.SubHeader className="h-11"> | ||
<Tabs variant="navigation" value={activeTab}> | ||
<TabsList fontSize="xs"> | ||
<TabsTrigger role="link" value="general" onClick={makeHandleTabChange('general')}> | ||
{t('views:profileSettings.GeneralTab', 'General')} | ||
</TabsTrigger> | ||
<TabsTrigger role="link" value="keys" onClick={makeHandleTabChange('keys')}> | ||
{t('views:profileSettings.KeysTab', 'Keys and Tokens')} | ||
</TabsTrigger> | ||
</TabsList> | ||
</Tabs> | ||
</SandboxLayout.SubHeader> | ||
</> | ||
) | ||
} | ||
|
||
export { ProfileSettingsTabNav } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.