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

Auth, UI: Visually updated StepIndicator component, open terms in new tab #92

Merged
merged 2 commits into from
Apr 16, 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
2 changes: 1 addition & 1 deletion packages/auth/components/login-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const LoginPanel: React.FC<PropsWithChildren & {
<ProviderLoginButton provider='github' isLoading={isLoading} loginWithProvider={loginWithProvider}>
<GitHub height={20}/>Github
</ProviderLoginButton>
<p className='text-sm text-muted-2'>By logging in, you agree to our <Link href={termsOfServiceUrl ?? ''}>Terms of Service</Link> and <Link href={privacyPolicyUrl ?? ''}>Privacy Policy</Link>.</p>
<p className='text-sm text-muted-2'>By logging in, you agree to our <Link href={termsOfServiceUrl ?? ''} target='_blank'>Terms of Service</Link> and <Link href={privacyPolicyUrl ?? ''} target='_blank'>Privacy Policy</Link>.</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikrakuscek This may seem like the opposite of what I say about using Blocks, but why not just put a LinkElement there? What's why I create them: as a convenient wrapper around links that can be predefined. Not worth changing since this is "on off" but just keep it in mind goign foward

</>
)}
</ApplyTypography>
Expand Down
25 changes: 21 additions & 4 deletions packages/ui/primitives/step-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,37 @@ const StepIndicator: React.FC<{
style={{ paddingLeft: pX, paddingRight: pX }}
>
{steps.map((ignore, index) => (<>
{index !== 0 && (<div key={`sep-${index}`} className={'h-[1px] grow ' + (muted ? 'bg-muted' : 'bg-foreground')}/>)}
{index !== 0 && (
<div
key={`sep-${index}`}
className={cn(
'h-[1px] grow',
currentStep >= index ? (muted ? 'bg-muted' : 'bg-foreground') : (muted ? 'bg-muted-3' : 'bg-level-3'),
)}
/>
)}
<div
key={`circle-${index}`}
style={{width: `${dotSizeRem}rem`, height: `${dotSizeRem}rem`}}
className={cn(
'shrink-0 rounded-full border-[1.5px] ' + (muted ? 'border-muted' : 'border-foreground') ,
currentStep === index ? (muted ? 'bg-muted' : 'bg-foreground') : ''
'shrink-0 rounded-full border-[1.5px]',
currentStep === index ? (muted ? 'bg-muted-3 border-muted' : 'bg-level-3 border-foreground') : '',
currentStep > index || currentStep === steps.length - 1 ? (muted ? 'bg-muted border-muted' : 'bg-foreground border-foreground') : ''
)}
/>
</>))}
</div>
<div key='two' className={'grid ' + `grid-cols-${steps.length}` /* These are white listed already */} >
{steps.map((label, index) => (
<div key={index} className={'text-center whitespace-nowrap ' + (muted ? 'text-muted' : 'text-foreground')} >{label}</div>
<div
key={index}
className={cn(
'text-center whitespace-nowrap',
(muted ? 'text-muted' : 'text-foreground')
)}
>
{label}
</div>
))}
</div>
</div>
Expand Down
Loading