refine link sharing on jobs/comments

This commit is contained in:
keyan 2022-12-19 17:21:47 -06:00
parent ee17518abf
commit b96f014906
2 changed files with 8 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import styles from './item.module.css'
import Link from 'next/link'
import { timeSince } from '../lib/time'
import EmailIcon from '../svgs/mail-open-line.svg'
import Share from './share'
export default function ItemJob ({ item, toc, rank, children }) {
const isEmail = Yup.string().email().isValidSync(item.url)
@ -73,7 +74,11 @@ export default function ItemJob ({ item, toc, rank, children }) {
{item.maxBid > 0 && item.status === 'ACTIVE' && <Badge className={`${styles.newComment} ml-1`}>PROMOTED</Badge>}
</div>
</div>
{toc && <Toc text={item.text} />}
{toc &&
<>
<Share item={item} />
<Toc text={item.text} />
</>}
</div>
{children && (
<div className={`${styles.children}`} style={{ marginLeft: 'calc(42px + .8rem)' }}>

View File

@ -9,7 +9,7 @@ export default function Share ({ item }) {
return typeof window !== 'undefined' && navigator?.share
? (
<div className='d-flex align-items-center'>
<div className='ml-auto d-flex align-items-center'>
<ShareIcon
onClick={() => {
if (navigator.share) {
@ -26,7 +26,7 @@ export default function Share ({ item }) {
/>
</div>)
: (
<Dropdown alignRight className='pointer d-flex align-items-center' as='span'>
<Dropdown alignRight className='ml-auto pointer d-flex align-items-center' as='span'>
<Dropdown.Toggle variant='success' id='dropdown-basic' as='a'>
<ShareIcon className='mx-2 fill-grey theme' />
</Dropdown.Toggle>