Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add refs to pro badge #3202

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function AddLicenseKey() {
<Stack direction="row" gap={2} align="center" justify="between">
<Heading size="medium">{t('licenseKey')}</Heading>
<Stack direction="row" gap={2} align="center">
<ProBadge />
<ProBadge link="https://tokens.studio/plugin?ref=add-license-key" />
{existingKey && !licenseKeyError && (
<ManageSubscriptionLink href="https://account.tokens.studio" target="_blank">
{t('manageSubscription')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default function BranchSelector() {
<>
<DropdownMenu.Item css={{ display: 'flex', justifyContent: 'space-between' }}>
<span>{t('upgradeToPro', { ns: 'licence' })}</span>
<ProBadge compact />
<ProBadge link="https://tokens.studio/plugin?ref=branch-selector" compact />
</DropdownMenu.Item>
<DropdownMenu.Separator />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default function ColorTokenForm({
<Box css={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<Box css={{ display: 'flex', gap: '$3', alignItems: 'center' }}>
<Heading size="small">{t('modify')}</Heading>
<ProBadge compact />
<ProBadge link="https://tokens.studio/plugin?ref=modifiers" compact />
</Box>
{
!modifyVisible ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function Footer() {
<a href="https://tokens.studio/changelog" target="_blank" rel="noreferrer">{`V ${pjs.version}`}</a>
</Box>
<Stack direction="row" gap={1}>
<ProBadge />
<ProBadge link="https://tokens.studio/plugin?ref=footer" />
<IconButton
as="a"
href={docUrls.root}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ export const StyledProBadge = styled('a', {
});

type Props = {
compact?: boolean;
readonly compact?: boolean;
readonly link?: string;
};

export default function ProBadge({ compact }: Props) {
export default function ProBadge({ compact, link }: Props) {
const existingKey = useSelector(licenseKeySelector);
const licenseKeyError = useSelector(licenseKeyErrorSelector);
const { t } = useTranslation(['licence']);

return (
<StyledProBadge href="https://tokens.studio/plugin" target="_blank">{(existingKey && !licenseKeyError) || compact ? t('pro') : t('getPro')}</StyledProBadge>
<StyledProBadge href={link} target="_blank">{(existingKey && !licenseKeyError) || compact ? t('pro') : t('getPro')}</StyledProBadge>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const ThemeSelector: React.FC<React.PropsWithChildren<React.PropsWithChil
onSelect={handleManageThemes}
>
<span>{t('manageThemes')}</span>
{!isProUser && <ProBadge compact />}
{!isProUser && <ProBadge link="https://tokens.studio/plugin?ref=manage-themes" compact />}
<DropdownMenu.TrailingVisual>
<NavArrowRight />
</DropdownMenu.TrailingVisual>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function TokenListingHeading({
<Box css={{ padding: '$2', margin: '-$2' }}>{isCollapsed ? <IconCollapseArrow /> : <IconExpandArrow />}</Box>
</Tooltip>
<Heading size="small">{label}</Heading>
{isPro ? <ProBadge /> : null}
{isPro ? <ProBadge link={`https://tokens.studio/plugin?ref=${tokenKey}-listing`} /> : null}
</StyledTokenGroupHeadingButton>
<Box
css={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ProBadge from '@/app/components/ProBadge';
export const ProBadgeDefaultStory = (args) => {
return (
<Provider store={store}>
<ProBadge/>
<ProBadge link="https://tokens.studio/plugin?ref=storybook" >
</Provider>
)
}
Expand Down
Loading