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

Fix: Header DAO dropdown #36

Merged
merged 4 commits into from
Oct 12, 2023
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Updated `HeaderDao` dropdown item styling
- Updated `Dropdown` `:hover:focus` styling

## [0.3.0] - 2023-10-10

### Changed
Expand Down
13 changes: 9 additions & 4 deletions src/components/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const Dropdown: React.FC<DropdownProps> = ({
</DropdownMenu.Trigger>

<StyledContent {...rest}>
<DropdownMenu.Group className="space-y-0.5">
<DropdownMenu.Group className="flex flex-col gap-y-0.75">
{listItems?.map((li, index) => (
<StyledItem key={index} onSelect={li.callback}>
{li.component}
Expand All @@ -75,9 +75,14 @@ export const Dropdown: React.FC<DropdownProps> = ({
};

const StyledContent = styled(DropdownMenu.Content).attrs({
className: 'bg-ui-0 rounded-lg p-2 shadow-xl' as string | undefined,
className: 'bg-ui-0 rounded-xl p-1 shadow-xl' as string,
})``;

const StyledItem = styled(DropdownMenu.Item).attrs({
className: 'rounded-xl focus-visible:outline-primary',
})``;
className: 'rounded-xl outline-none focus:outline-none focus:ring focus:ring-primary-200',
})`
&:hover:focus {
outline: none;
box-shadow: none;
}
`;
15 changes: 5 additions & 10 deletions src/components/headers/headerDao.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const HeaderDao: React.FC<HeaderDaoProps> = ({
},
{
component: (
<CredentialsDropdownItem key={3} isLast onClick={() => onCopy?.(`https://${daoUrl}`)}>
<CredentialsDropdownItem key={3} onClick={() => onCopy?.(`https://${daoUrl}`)}>
{shortenDaoUrl(daoUrl)}
<StyledCopyIcon />
</CredentialsDropdownItem>
Expand Down Expand Up @@ -138,6 +138,7 @@ export const HeaderDao: React.FC<HeaderDaoProps> = ({
<Title>{daoName}</Title>

<Dropdown
className="w-30"
align="start"
trigger={
<CredentialsDropdownTrigger
Expand Down Expand Up @@ -295,15 +296,9 @@ const ActionWrapper = styled.div.attrs({
'flex items-center tablet:space-x-3 justify-between tablet:justify-start w-full tablet:w-max space-y-3 tablet:space-y-0',
})``;

type CredentialsDropdownItemProps = {
isLast?: boolean;
};

const CredentialsDropdownItem = styled.div.attrs<CredentialsDropdownItemProps>((props) => ({
className: `flex items-center justify-between gap-1.5 py-1 font-semibold ft-text-base text-ui-600 hover:text-ui-400 ${
props.isLast ? '' : 'mb-1'
}`,
}))<CredentialsDropdownItemProps>``;
const CredentialsDropdownItem = styled.div.attrs({
className: `flex text-ui-600 items-center justify-between gap-1.5 py-1.5 font-semibold ft-text-base hover:bg-primary-50 px-2 rounded-xl hover:text-primary-400`,
})``;

const CredentialsDropdownTrigger = styled(Link).attrs({
className:
Expand Down