From 239d0368135b73111d5227b4aa660ffc5f51b012 Mon Sep 17 00:00:00 2001 From: Weiko Date: Mon, 14 Aug 2023 17:40:10 -0700 Subject: [PATCH] Upgrade /front version and display the version in settings navbar (#1207) * Upgrade /front version and display the version in settings navbar * fix * fix version * restore center * add icon * Fix styled components --------- Co-authored-by: Charles Bochet --- front/package.json | 2 +- .../settings/components/SettingsNavbar.tsx | 2 +- front/src/modules/ui/icon/index.ts | 1 + .../ui/navbar/components/SubMenuNavbar.tsx | 57 +++++++++++++++++-- .../src/modules/ui/navbar/constants/index.ts | 2 + 5 files changed, 58 insertions(+), 6 deletions(-) diff --git a/front/package.json b/front/package.json index e0dcee673..4e1b73138 100644 --- a/front/package.json +++ b/front/package.json @@ -1,6 +1,6 @@ { "name": "twenty", - "version": "0.1.0", + "version": "0.1.2", "private": true, "dependencies": { "@air/react-drag-to-select": "^5.0.8", diff --git a/front/src/modules/settings/components/SettingsNavbar.tsx b/front/src/modules/settings/components/SettingsNavbar.tsx index d66126b74..221658a65 100644 --- a/front/src/modules/settings/components/SettingsNavbar.tsx +++ b/front/src/modules/settings/components/SettingsNavbar.tsx @@ -27,7 +27,7 @@ export function SettingsNavbar() { }, [signOut, navigate]); return ( - + theme.font.size.sm}; + font-weight: ${({ theme }) => theme.font.weight.medium}; + margin-bottom: ${({ theme }) => theme.spacing(2)}; + padding-left: ${({ theme }) => theme.spacing(1)}; +`; + +const StyledVersion = styled.span` + color: ${({ theme }) => theme.font.color.light}; + :hover { + color: ${({ theme }) => theme.font.color.tertiary}; + } + padding-left: ${({ theme }) => theme.spacing(1)}; +`; + +const StyledVersionLink = styled.a` + align-items: center; + color: ${({ theme }) => theme.font.color.light}; + display: flex; + text-decoration: none; + :hover { + color: ${({ theme }) => theme.font.color.tertiary}; + } +`; + const StyledContainer = styled.div` display: flex; flex-direction: column; + height: 100%; + justify-content: space-between; padding-top: ${({ theme }) => theme.spacing(9)}; width: ${() => (useIsMobile() ? '100%' : leftNavbarWidth.desktop)}; `; -export default function SubMenuNavbar({ children, backButtonTitle }: OwnProps) { +export default function SubMenuNavbar({ + children, + backButtonTitle, + displayVersion, +}: OwnProps) { + const version = packageJson.version; + + const theme = useTheme(); + return ( - - {children} +
+ + {children} +
+ {displayVersion && ( + + + + {version} + + + )}
); } diff --git a/front/src/modules/ui/navbar/constants/index.ts b/front/src/modules/ui/navbar/constants/index.ts index 415925d63..eb7ae04d2 100644 --- a/front/src/modules/ui/navbar/constants/index.ts +++ b/front/src/modules/ui/navbar/constants/index.ts @@ -12,3 +12,5 @@ export const navbarIconSize = { mobile: 18, desktop: 16, }; + +export const githubLink = 'https://github.com/twentyhq/twenty';