Skip to content

Commit

Permalink
style: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
liukai committed Mar 15, 2024
1 parent 7c9ccf8 commit b8e48bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion packages/emoji-mart/src/components/Emoji/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ export default function Emoji(props) {
<span
style={{
fontSize: props.size,
backfaceVisibility: UserAgent.isMacOs && UserAgent.chromeVersion > 0 && UserAgent.chromeVersion < 121 ? 'hidden': undefined,
backfaceVisibility:
UserAgent.isMacOs &&
UserAgent.chromeVersion > 0 &&
UserAgent.chromeVersion < 121
? 'hidden'
: undefined,
fontFamily:
'"EmojiMart", "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"',
}}
Expand Down
7 changes: 6 additions & 1 deletion packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,12 @@ export default class Picker extends Component {
aria-hidden="true"
class="background"
style={{
backfaceVisibility: UserAgent.isMacOs && UserAgent.chromeVersion > 0 && UserAgent.chromeVersion < 121 ? 'hidden': undefined,
backfaceVisibility:
UserAgent.isMacOs &&
UserAgent.chromeVersion > 0 &&
UserAgent.chromeVersion < 121
? 'hidden'
: undefined,
borderRadius: this.props.emojiButtonRadius,
backgroundColor: this.props.emojiButtonColors
? this.props.emojiButtonColors[
Expand Down
6 changes: 4 additions & 2 deletions packages/emoji-mart/src/helpers/user-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ const agent: string = window.navigator.userAgent.toLowerCase()

const isMacOs: boolean = agent.indexOf('mac') !== -1
const isChrome: boolean = agent.indexOf('chrome') > -1
const chromeVersion: number = isChrome ? parseInt(agent.match(/chrome\/(\d{2})/)[1]) : 0
const chromeVersion: number = isChrome
? parseInt(agent.match(/chrome\/(\d{2})/)[1])
: 0

export default {
isMacOs,
isChrome,
chromeVersion,
}
}

0 comments on commit b8e48bf

Please sign in to comment.