-
Notifications
You must be signed in to change notification settings - Fork 72
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
Showing
43 changed files
with
167 additions
and
293 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
...io-components/src/components/StudioContentMenu/StudioButtonTab/StudioButtonTab.module.css
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
...bs/studio-components/src/components/StudioContentMenu/StudioButtonTab/StudioButtonTab.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
frontend/libs/studio-components/src/components/StudioContentMenu/StudioButtonTab/index.ts
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...onents/StudioContentMenu/StudioContentMenuButtonTab/StudioContentMenuButtonTab.module.css
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,6 @@ | ||
.buttonTab { | ||
all: unset; | ||
display: var(--tab-display); | ||
align-items: var(--tab-align-items); | ||
width: var(--tab-width); | ||
} |
2 changes: 1 addition & 1 deletion
2
...bs/studio-components/src/components/StudioContentMenu/StudioContentMenuWrapper.module.css
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.contentMenuWrapper { | ||
height: 300px; | ||
width: 200px; | ||
width: 20vw; | ||
} |
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
10 changes: 0 additions & 10 deletions
10
...studio-components/src/components/StudioContentMenu/StudioLinkTab/StudioLinkTab.module.css
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
...d/libs/studio-components/src/components/StudioContentMenu/StudioLinkTab/StudioLinkTab.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
frontend/libs/studio-components/src/components/StudioContentMenu/StudioLinkTab/index.ts
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
...src/components/StudioContentMenu/StudioMenuTabContainer/StudioMenuTabContainer.module.css
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
...onents/src/components/StudioContentMenu/StudioMenuTabContainer/StudioMenuTabContainer.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...d/libs/studio-components/src/components/StudioContentMenu/StudioMenuTabContainer/index.ts
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
frontend/libs/studio-components/src/components/StudioContentMenu/types/StudioMenuTabType.ts
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
frontend/libs/studio-content-library/src/ContentLibrary/LibraryContent/LibraryContent.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,39 @@ | ||
import React from 'react'; | ||
import classes from '../ContentLibrary.module.css'; | ||
import { PagesRouter } from './PagesRouter'; | ||
import { InfoBox } from './InfoBox'; | ||
import type { PagePropsMap, PagesConfig } from '../../types/PagesProps'; | ||
import type { PageName } from '../../types/PageName'; | ||
import type { PageComponent } from '../../utils/router/RouterRouteMapper'; | ||
|
||
type LibraryContentProps<T extends PageName = 'landingPage'> = { | ||
Component: PageComponent<Required<PagePropsMap>[T]>; | ||
pages: PagesConfig; | ||
currentPage: PageName; | ||
}; | ||
|
||
export function LibraryContent<T extends PageName = 'landingPage'>({ | ||
Component, | ||
pages, | ||
currentPage, | ||
}: LibraryContentProps) { | ||
const componentPropsAreExternal = currentPage !== 'landingPage'; | ||
|
||
const componentProps: Required<PagePropsMap>[T] = | ||
componentPropsAreExternal && (pages[currentPage].props as Required<PagePropsMap>[T]); | ||
|
||
return ( | ||
<div className={classes.libraryContent}> | ||
<PagesRouter pageNames={getAllPageNamesFromPagesConfig(pages)} /> | ||
<div className={classes.component}> | ||
<Component {...componentProps} /> | ||
</div> | ||
<InfoBox pageName={currentPage} /> | ||
</div> | ||
); | ||
} | ||
|
||
const getAllPageNamesFromPagesConfig = (pages: PagesConfig): PageName[] => { | ||
const customPages = Object.keys(pages) as PageName[]; | ||
return ['landingPage', ...customPages]; | ||
}; |
Oops, something went wrong.