-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(replay): Extract useTimelineScale from useReplayContext and tweak…
… ui styles (#73613) The UI tweaks come from this older figma: https://www.figma.com/design/tlGOyIijfu309du7zXTDTM/Library%3A-Replay?node-id=0-1&t=iRFVZSPdf7cuccpS-0 Changes: - Down Triangle for both sides - Triangle is a little higher, so it's not cutoff by the scrubber circle when they point to the same spot (see image below) - Unicode `x` - font size/weight/color changes for the current/total time labels **After:** <img width="704" alt="SCR-20240701-oerr" src="https://github.com/getsentry/sentry/assets/187460/3f5152d2-bf75-468e-9cfc-a498a3aed0d1">
- Loading branch information
Showing
5 changed files
with
60 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {createContext, useContext, useState} from 'react'; | ||
|
||
const context = createContext<[scale: number, setScale: (scale: number) => void]>([ | ||
1, | ||
(_scale: number) => {}, | ||
]); | ||
|
||
export function TimelineScaleContextProvider({children}: {children: React.ReactNode}) { | ||
const state = useState(1); | ||
|
||
return <context.Provider value={state}>{children}</context.Provider>; | ||
} | ||
|
||
export default function useTimelineScale() { | ||
return useContext(context); | ||
} |