Skip to content

Commit

Permalink
fix: range picker add pointer cusor
Browse files Browse the repository at this point in the history
  • Loading branch information
zhbhun committed Oct 28, 2023
1 parent 2acfcde commit 6b391de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/common/src/components/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export function RangePicker({
viewBox={`0 0 ${rangeWidth} 56`}
focusable="false"
style={{
cursor: 'pointer',
transform: `translate(${offsetX}px, 0)`,
touchAction: 'none',
}}
Expand All @@ -194,6 +195,7 @@ export function RangePicker({
sx={{
background: 'radial-gradient(#121212, rgba(0, 0, 0, 0))',
pointerEvents: 'none',
userSelect: 'none',
}}
>
{`${format ? format(value) : value}${unit}`}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const BACKGROUND_COLORS = [
export const ID_PHOTO_SPECS = SPEC as IDPhotoSpec[]

export const ID_PHOTO_LOCALE_SPECS = ID_PHOTO_SPECS.filter((spec) => {
return spec.languages.includes(navigator.language)
return spec.languages?.includes(navigator.language)
})

export const ID_PHOTO_VISA_SPECS = ID_PHOTO_SPECS.filter(
Expand Down
5 changes: 3 additions & 2 deletions packages/common/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ export type IDPhotoType =
| 'visa'
| 'driving'
| 'generic'
| 'custom'
| 'others'

export interface IDPhotoSpec {
name: string
type: IDPhotoType
title: string
country: string
languages: string[]
languages?: string[]
definition?: {
headHeight: number
headTop: number
Expand All @@ -28,7 +29,7 @@ export interface IDPhotoSpec {
}
color: string
comment?: string
links: string[]
links?: string[]
}

export interface IDPhotoGroup {
Expand Down

0 comments on commit 6b391de

Please sign in to comment.