Skip to content

Commit

Permalink
fix: Menu on safari (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
RabbitDoge authored Nov 12, 2020
1 parent 96bc548 commit 5d5db86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface Props {
}

const DropdownContent = styled.div`
width: max-content;
display: none;
flex-direction: column;
position: absolute;
Expand All @@ -21,7 +22,6 @@ const DropdownContent = styled.div`
`;

const Container = styled.div`
width: fit-content;
position: relative;
&:hover ${DropdownContent}, &:focus-within ${DropdownContent} {
display: flex;
Expand Down
16 changes: 6 additions & 10 deletions src/widgets/Nav/Buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ import styled from "styled-components";
import { NavLink } from "react-router-dom";
import Button from "../../components/Button";

const MobileOnlyButton = styled(Button)`
${({ theme }) => theme.mediaQueries.nav} {
display: none;
}
`;
MobileOnlyButton.defaultProps = {
variant: "text",
size: "sm",
};

const MenuButton = styled(Button)`
padding: 0 8px;
border-radius: 8px;
Expand All @@ -22,6 +12,12 @@ MenuButton.defaultProps = {
size: "sm",
};

const MobileOnlyButton = styled(MenuButton)`
${({ theme }) => theme.mediaQueries.nav} {
display: none;
}
`;

const MenuLink: React.FC<AnchorHTMLAttributes<HTMLAnchorElement>> = ({ href = "", children, ...props }) => {
return href.startsWith("http") ? (
<a key={href} className="link" href={href} {...props}>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/Nav/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const Panel: React.FC<Props> = ({
size="sm"
onClick={() => setLang(lang)}
// Safari specific fix
style={{ minHeight: "32px", width: "max-content" }}
style={{ minHeight: "32px", height: "auto" }}
>
{lang.language}
</Button>
Expand Down

0 comments on commit 5d5db86

Please sign in to comment.