diff --git a/public/icons/logout.svg b/public/icons/logout.svg new file mode 100644 index 00000000..a28a25c8 --- /dev/null +++ b/public/icons/logout.svg @@ -0,0 +1,4 @@ + + + diff --git a/public/icons/profile.svg b/public/icons/profile.svg new file mode 100644 index 00000000..23c7e580 --- /dev/null +++ b/public/icons/profile.svg @@ -0,0 +1,4 @@ + + + diff --git a/src/components/Feed/ArticleCard/ArticleCard.module.scss b/src/components/Feed/ArticleCard/ArticleCard.module.scss index 336d82c8..d19865b1 100644 --- a/src/components/Feed/ArticleCard/ArticleCard.module.scss +++ b/src/components/Feed/ArticleCard/ArticleCard.module.scss @@ -603,6 +603,7 @@ .shoutCardDetailsItem { align-items: center; display: flex; + font-size: 1.4rem; margin-right: 1.2rem; white-space: nowrap; diff --git a/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss b/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss index 54b1df3a..d9141883 100644 --- a/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss +++ b/src/components/Feed/FeedArticlePopup/FeedArticlePopup.module.scss @@ -1,7 +1,4 @@ .feedArticlePopup { - box-shadow: none !important; - border: 1px solid rgb(0 0 0 / 15%); - border-radius: 1.6rem; padding: 0 !important; text-align: left; overflow: hidden; diff --git a/src/components/Nav/ProfilePopup.tsx b/src/components/Nav/ProfilePopup.tsx index ce645d6d..bdaa9f60 100644 --- a/src/components/Nav/ProfilePopup.tsx +++ b/src/components/Nav/ProfilePopup.tsx @@ -6,8 +6,10 @@ import { useLocalize } from '../../context/localize' import { useSession } from '../../context/session' import { router } from '../../stores/router' import { Popup } from '../_shared/Popup' +import { Icon } from '../_shared/Icon' import styles from '../_shared/Popup/Popup.module.scss' +import {clsx} from 'clsx'; type ProfilePopupProps = Omit @@ -19,27 +21,44 @@ export const ProfilePopup = (props: ProfilePopupProps) => { - {t('Profile')} + + + {t('Profile')} + - {t('Drafts')} + + + {t('Drafts')} + - + + {t('Subscriptions')} - {t('Comments')} + + + {t('Comments')} + - {t('Bookmarks')} + + + {t('Bookmarks')} + - {t('Settings')} + + + {t('Settings')} + - signOut()}> + signOut()}> + {t('Logout')} diff --git a/src/components/_shared/DropDown/DropDown.tsx b/src/components/_shared/DropDown/DropDown.tsx index 48115e5b..ba144b30 100644 --- a/src/components/_shared/DropDown/DropDown.tsx +++ b/src/components/_shared/DropDown/DropDown.tsx @@ -6,6 +6,7 @@ import { For, Show, createSignal } from 'solid-js' import { Popup } from '../Popup' import styles from './DropDown.module.scss' +import popupStyles from '../Popup/Popup.module.scss' export type Option = { value: string | number @@ -56,16 +57,20 @@ export const DropDown = (props: Props) onVisibilityChange={(isVisible) => setIsPopupVisible(isVisible)} {...props.popupProps} > - - {(option) => ( - props.onChange(option)} - > - {option.title} - - )} - + + + {(option) => ( + + props.onChange(option)} + > + {option.title} + + + )} + + ) diff --git a/src/components/_shared/Popup/Popup.module.scss b/src/components/_shared/Popup/Popup.module.scss index 5db976f9..5d27cd6e 100644 --- a/src/components/_shared/Popup/Popup.module.scss +++ b/src/components/_shared/Popup/Popup.module.scss @@ -8,10 +8,14 @@ .popup { background: var(--background-color); + border: 1px solid rgb(0 0 0 / 15%); + border-radius: 1.6rem; + box-shadow: 0 8px 16px 0 rgb(0 0 0 / 5%); color: var(--default-color); cursor: default; min-width: 144px; opacity: 1; + overflow: hidden; position: absolute; text-align: left; top: calc(100% + 11px); @@ -21,6 +25,7 @@ margin-bottom: 0; li { + margin: 0; position: relative; &:last-child { @@ -29,33 +34,19 @@ } } - &.bordered { - @include font-size(1.6rem); - - border: 2px solid #000; - padding: 2.4rem; - - ul li { - margin-bottom: 1.6rem; - - &:last-child { - margin-bottom: 0; - } - } - } - &.tiny { @include font-size(1.4rem); - box-shadow: 0 4px 60px rgb(0 0 0 / 10%); - padding: 1rem; + .action { + padding: 0.5rem 1rem; + } - ul li { - margin-bottom: 1rem; + li:first-child .action { + padding-top: 1rem; + } - &:last-child { - margin-bottom: 0; - } + li:last-child .action { + padding-bottom: 1rem; } } @@ -75,7 +66,6 @@ .topBorderItem { border-top: 2px solid; - padding-top: 1em; } a:link, @@ -83,26 +73,58 @@ border: none; white-space: nowrap; - &:hover { - .icon img { - filter: invert(0); - } + &:before { + content: ''; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } } .icon { display: inline-block; - width: 3.6rem; + margin-right: 1rem; + width: 2.4rem; img { display: inline-block; - filter: invert(1); - max-height: 2rem; - max-width: 2rem; + max-height: 2.4rem; + max-width: 2.4rem; transition: filter 0.3s; vertical-align: middle; } } + + .action { + display: flex; + align-items: center; + width: 100%; + box-sizing: border-box; + padding: 8px 16px; + font-size: inherit; + font-weight: 500; + text-align: left; + white-space: nowrap; + + &:hover { + background: var(--black-500); + color: var(--black-50) !important; + + .icon img { + filter: invert(1); + } + } + } + + li:first-child .action { + padding-top: 16px; + } + + li:last-child .action { + padding-bottom: 16px; + } } // TODO: animation diff --git a/src/components/_shared/Popup/Popup.tsx b/src/components/_shared/Popup/Popup.tsx index e9e2a49c..1d9fb7b2 100644 --- a/src/components/_shared/Popup/Popup.tsx +++ b/src/components/_shared/Popup/Popup.tsx @@ -14,7 +14,7 @@ export type PopupProps = { children: JSX.Element onVisibilityChange?: (isVisible: boolean) => void horizontalAnchor?: HorizontalAnchor - variant?: 'bordered' | 'tiny' + variant?: 'tiny' closePopup?: boolean } @@ -54,7 +54,6 @@ export const Popup = (props: PopupProps) => { class={clsx(styles.popup, props.popupCssClass, { [styles.horizontalAnchorCenter]: horizontalAnchor === 'center', [styles.horizontalAnchorRight]: horizontalAnchor === 'right', - [styles.bordered]: props.variant === 'bordered', [styles.tiny]: props.variant === 'tiny', })} > diff --git a/src/components/_shared/ShareLinks/ShareLinks.module.scss b/src/components/_shared/ShareLinks/ShareLinks.module.scss index d65ee4aa..0066714d 100644 --- a/src/components/_shared/ShareLinks/ShareLinks.module.scss +++ b/src/components/_shared/ShareLinks/ShareLinks.module.scss @@ -7,9 +7,6 @@ white-space: nowrap; &:hover { - background: #000; - color: #fff; - .icon img { filter: invert(0); } @@ -17,7 +14,7 @@ .icon { display: inline-block; - width: 3.6rem; + width: 2rem; img { display: inline-block; diff --git a/src/components/_shared/ShareLinks/ShareLinks.tsx b/src/components/_shared/ShareLinks/ShareLinks.tsx index 0e1bd98f..3034aaa8 100644 --- a/src/components/_shared/ShareLinks/ShareLinks.tsx +++ b/src/components/_shared/ShareLinks/ShareLinks.tsx @@ -8,6 +8,7 @@ import { Icon } from '../Icon' import { Popover } from '../Popover' import styles from './ShareLinks.module.scss' +import popupStyles from '../Popup/Popup.module.scss' type Props = { title: string @@ -53,26 +54,26 @@ export const ShareLinks = (props: Props) => { - handleShare(FACEBOOK)}> - + handleShare(FACEBOOK)}> + Facebook - handleShare(TWITTER)}> - + handleShare(TWITTER)}> + Twitter - handleShare(TELEGRAM)}> - + handleShare(TELEGRAM)}> + Telegram - handleShare(VK)}> - + handleShare(VK)}> + VK @@ -80,8 +81,8 @@ export const ShareLinks = (props: Props) => { - + + {t('Copy link')} } @@ -93,7 +94,7 @@ export const ShareLinks = (props: Props) => { {(triggerRef: (el) => void) => ( - + )}