Skip to content

Commit

Permalink
feat: change brand images and colors at the root page (#495)Co-author…
Browse files Browse the repository at this point in the history
…ed-by: rot1024 <[email protected]>

* impl brand chage

* Update src/components/molecules/RootPage/index.tsx

Co-authored-by: rot1024 <[email protected]>

---------

Co-authored-by: rot1024 <[email protected]>
  • Loading branch information
HideBa and rot1024 authored Feb 28, 2023
1 parent 93c8051 commit 4f07b93
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/components/molecules/Dashboard/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export interface Props {
const Logo: React.FC<Props> = ({ className }) => {
return (
<Wrapper align="center" justify="center" className={className}>
{window.REEARTH_CONFIG?.logoUrl ? (
<img src={window.REEARTH_CONFIG.logoUrl} style={{ maxWidth: "100%" }} />
{window.REEARTH_CONFIG?.brand?.logoUrl ? (
<img src={window.REEARTH_CONFIG.brand.logoUrl} style={{ maxWidth: "100%" }} />
) : (
<Icon icon="logoColorful" size={122} />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/Dashboard/QuickStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const QuickStart: React.FC<Props> = ({
direction="column"
align="center"
justify="center"
linearGradient={window.REEARTH_CONFIG?.linearGradient}
linearGradient={window.REEARTH_CONFIG?.brand?.background}
onClick={() => setProjCreateOpen(true)}>
<StyledIcon icon="newProject" size={70} />
<Text size="m" weight="bold" customColor>
Expand Down
22 changes: 14 additions & 8 deletions src/components/molecules/RootPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@ export type Props = {
const RootPage: React.FC<Props> = ({ loading }) => {
const theme = useTheme();
return (
<Wrapper justify="center" align="center" direction="column">
<StyledIcon icon="logo" size={200} />
<Wrapper
justify="center"
align="center"
direction="column"
gap={100}
bg={window.REEARTH_CONFIG?.brand?.background}>
{window.REEARTH_CONFIG?.brand?.logoUrl ? (
<img src={window.REEARTH_CONFIG.brand.logoUrl} style={{ width: 200 }} />
) : (
<Icon icon="logo" size={200} />
)}
{loading && <RingLoader size={35} color={theme.main.strongText} />}
</Wrapper>
);
};

const Wrapper = styled(Flex)`
const Wrapper = styled(Flex)<{ bg?: string }>`
height: 100%;
background: ${({ theme }) =>
background: ${({ theme, bg }) =>
bg ||
`linear-gradient(70deg, ${theme.main.brandBlue} 10%, ${theme.main.brandRed} 60%, ${theme.main.brandBlue} 90%)`};
`;

const StyledIcon = styled(Icon)`
margin-bottom: 100px;
`;

export default RootPage;
4 changes: 2 additions & 2 deletions src/components/molecules/Settings/Navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const Navigation: React.FC<Props> = ({ team, project }) => {
return (
<Wrapper>
<LogoWrapper>
{window.REEARTH_CONFIG?.logoUrl ? (
<img src={window.REEARTH_CONFIG.logoUrl} style={{ maxWidth: "100%" }} />
{window.REEARTH_CONFIG?.brand?.logoUrl ? (
<img src={window.REEARTH_CONFIG.brand.logoUrl} style={{ maxWidth: "100%" }} />
) : (
<Icon icon="logoColorful" size={110} />
)}
Expand Down
6 changes: 4 additions & 2 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export type Config = {
sentryDsn?: string;
sentryEnv?: string;
cesiumIonAccessToken?: string;
logoUrl?: string;
linearGradient?: string;
brand?: {
logoUrl?: string;
background?: string;
};
passwordPolicy?: {
tooShort?: RegExp;
tooLong?: RegExp;
Expand Down

0 comments on commit 4f07b93

Please sign in to comment.