Skip to content

Conversation

@nmoskaleva
Copy link
Collaborator

@nmoskaleva nmoskaleva commented Jan 19, 2026

To further align the documentation with the design system.

QA: Please check the updated buttons:

Screenshot 2026-01-19 at 16 13 01

@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for criipto-docs ready!

Name Link
🔨 Latest commit 2fb60bc
🔍 Latest deploy log https://app.netlify.com/projects/criipto-docs/deploys/697340699a00780008ffa208
😎 Deploy Preview https://deploy-preview-274--criipto-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nmoskaleva nmoskaleva marked this pull request as ready for review January 19, 2026 15:15
@nmoskaleva nmoskaleva requested review from Trinurt and jlndk January 19, 2026 15:15
To further align the documentation with the design system.
Copy link

@Trinurt Trinurt left a comment

Choose a reason for hiding this comment

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

I like it very much 👍

Comment on lines 27 to 43
const variants = {
primary: cx('bg-primary-600 text-white', !isDisabled && 'hover:bg-primary-800'),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
!isDisabled && 'hover:bg-primary-600/10',
),
dark: cx(
'bg-transparent border border-white/40 text-white',
!isDisabled && 'hover:bg-white/20',
),
};

const sizes = {
sm: 'h-8 leading-4',
md: 'h-10 leading-4',
lg: 'h-12 leading-5 text-base',
};
Copy link
Contributor

Choose a reason for hiding this comment

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

For extra type-safety and to produce more actionable error messages when we add new variants, I would propose adding an explicit type annotation to these definitions

Suggested change
const variants = {
primary: cx('bg-primary-600 text-white', !isDisabled && 'hover:bg-primary-800'),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
!isDisabled && 'hover:bg-primary-600/10',
),
dark: cx(
'bg-transparent border border-white/40 text-white',
!isDisabled && 'hover:bg-white/20',
),
};
const sizes = {
sm: 'h-8 leading-4',
md: 'h-10 leading-4',
lg: 'h-12 leading-5 text-base',
};
const variants: Record<BaseButtonProps['variant'], string> = {
primary: cx('bg-primary-600 text-white', !isDisabled && 'hover:bg-primary-800'),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
!isDisabled && 'hover:bg-primary-600/10',
),
dark: cx(
'bg-transparent border border-white/40 text-white',
!isDisabled && 'hover:bg-white/20',
),
};
const sizes: Record<BaseButtonProps['size'], string> = {
sm: 'h-8 leading-4',
md: 'h-10 leading-4',
lg: 'h-12 leading-5 text-base',
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 27 to 37
const variants = {
primary: cx('bg-primary-600 text-white', !isDisabled && 'hover:bg-primary-800'),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
!isDisabled && 'hover:bg-primary-600/10',
),
dark: cx(
'bg-transparent border border-white/40 text-white',
!isDisabled && 'hover:bg-white/20',
),
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be personal preference, but since you're using classNames, I would propose using the object syntax to define the conditional classes instead, since it makes it much easier to add multiple cases in the future.

Suggested change
const variants = {
primary: cx('bg-primary-600 text-white', !isDisabled && 'hover:bg-primary-800'),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
!isDisabled && 'hover:bg-primary-600/10',
),
dark: cx(
'bg-transparent border border-white/40 text-white',
!isDisabled && 'hover:bg-white/20',
),
};
const variants = {
primary: cx('bg-primary-600 text-white', { 'hover:bg-primary-800': !isDisabled }),
default: cx(
'border border-light-blue-700/30 text-light-blue-800 bg-transparent',
{ 'hover:bg-primary-600/10': !isDisabled },
),
dark: cx(
'bg-transparent border border-white/40 text-white',
{ 'hover:bg-white/20': !isDisabled },
),
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

return cx(base, variants[props.variant], sizes[size], iconPadding, isDisabled && 'opacity-40');
}

function Inner(props: BaseButtonProps & (TextButtonProps | IconButtonProps)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Proposing renaming this to ButtonContent to better describe the component

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

extends React.ButtonHTMLAttributes<HTMLButtonElement>,
BaseButtonProps {}

export default function Button({
Copy link
Contributor

Choose a reason for hiding this comment

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

Propose removing the default from the export, since it improves auto-complete discoverability and consistency in imports

See more: https://dev.to/phuocng/avoid-using-default-exports-a1c

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had no idea! Thanks! 2fb60bc

Comment on lines 220 to 224
<Button variant="primary" size="sm" className="uppercase">
<a href="https://dashboard.idura.app/signup?utm_source=docs" target="_blank">
Sign up
</a>
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be a potential use for the AnchorButton?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 2fb60bc

@nmoskaleva nmoskaleva requested a review from jlndk January 23, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants