0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

feat(console): cloud preview broadcast (#3314)

This commit is contained in:
Xiao Yijun 2023-03-08 11:42:54 +08:00 committed by GitHub
parent 56ffba151b
commit 190b281b49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 4 deletions

View file

@ -0,0 +1,19 @@
@use '@/scss/underscore' as _;
.broadcast {
background-color: var(--color-layer-1);
position: absolute;
top: _.unit(4);
left: 50%;
font: var(--font-label-2);
border-radius: 18px;
padding: _.unit(2) _.unit(5);
box-shadow: var(--shadow-2);
user-select: none;
text-align: center;
transform: translateX(-50%);
.link {
margin-left: _.unit(3);
}
}

View file

@ -0,0 +1,21 @@
import { useTranslation } from 'react-i18next';
import { logtoBlogLink } from '@/cloud/constants';
import TextLink from '@/components/TextLink';
import * as styles from './index.module.scss';
const Broadcast = () => {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
return (
<div className={styles.broadcast}>
<span>{t('cloud.broadcast')}</span>
<TextLink href={logtoBlogLink} target="_blank" className={styles.link}>
{t('general.learn_more')}
</TextLink>
</div>
);
};
export default Broadcast;

View file

@ -4,6 +4,8 @@ import type { OnboardingSieConfig } from '../types';
import { Authentication } from '../types';
export const reservationLink = 'https://calendly.com/logto/30min';
export const logtoBlogLink =
'https://www.notion.so/silverhand/About-Logto-Cloud-Preview-ca316bc05f2a4b9188047da014124434?pvs=4';
export const defaultOnboardingSieConfig: OnboardingSieConfig = {
color: '#5D34F2',

View file

@ -4,6 +4,7 @@ import { useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { Outlet, useHref, useLocation, useNavigate } from 'react-router-dom';
import Broadcast from '@/cloud/components/Broadcast';
import useUserOnboardingData from '@/cloud/hooks/use-user-onboarding-data';
import { OnboardingPage } from '@/cloud/types';
import { getOnboardPagePathname } from '@/cloud/utils';
@ -78,10 +79,13 @@ const AppContent = () => {
}
return (
<div className={styles.app}>
<Topbar className={conditional(scrollTop && styles.topbarShadow)} />
<Outlet context={{ scrollableContent } satisfies AppContentOutletContext} />
</div>
<>
<div className={styles.app}>
<Topbar className={conditional(scrollTop && styles.topbarShadow)} />
<Outlet context={{ scrollableContent } satisfies AppContentOutletContext} />
</div>
{isCloud && <Broadcast />}
</>
);
};

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web',
},
},
broadcast: '📣 You are participating in Logto Cloud Preview',
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;

View file

@ -95,6 +95,7 @@ const cloud = {
web_tab: 'Web', // UNTRANSLATED
},
},
broadcast: '📣 You are participating in Logto Cloud Preview', // UNTRANSLATED
};
export default cloud;