@@ -12,7 +12,6 @@ import getFrameDetails from 'sentry/utils/replays/getFrameDetails';
1212import useActiveReplayTab from 'sentry/utils/replays/hooks/useActiveReplayTab' ;
1313import useCrumbHandlers from 'sentry/utils/replays/hooks/useCrumbHandlers' ;
1414import type { ReplayFrame } from 'sentry/utils/replays/types' ;
15- import type { Color } from 'sentry/utils/theme' ;
1615
1716const NODE_SIZES = [ 8 , 12 , 16 ] ;
1817
@@ -114,14 +113,14 @@ function Event({
114113 // Sort the frame colors by color priority
115114 // Priority order: red300, yellow300, green300, purple300, gray300
116115 const sortedUniqueColors = uniqueColors . sort ( function ( x , y ) {
117- const colorOrder : Color [ ] = [
118- 'red300' ,
119- 'yellow300' ,
120- 'green300' ,
121- 'purple300' ,
122- 'gray300' ,
116+ const colorOrder : string [ ] = [
117+ theme . tokens . graphics . danger ,
118+ theme . tokens . graphics . warning ,
119+ theme . tokens . graphics . success ,
120+ theme . tokens . graphics . accent ,
121+ theme . tokens . graphics . muted ,
123122 ] ;
124- function getColorPos ( c : Color ) {
123+ function getColorPos ( c : string ) {
125124 return colorOrder . indexOf ( c ) ;
126125 }
127126 return getColorPos ( x ) - getColorPos ( y ) ;
@@ -159,13 +158,13 @@ const getBackgroundGradient = ({
159158 frameCount,
160159 theme,
161160} : {
162- colors : Color [ ] ;
161+ colors : Array < keyof Theme [ 'tokens' ] [ 'graphics' ] > ;
163162 frameCount : number ;
164163 theme : Theme ;
165164} ) => {
166- const c0 = theme [ colors [ 0 ] ! ] ?? colors [ 0 ] ! ;
167- const c1 = theme [ colors [ 1 ] ! ] ?? colors [ 1 ] ! ?? c0 ;
168- const c2 = theme [ colors [ 2 ] ! ] ?? colors [ 2 ] ! ?? c1 ;
165+ const c0 = theme . tokens . graphics [ colors [ 0 ] ! ] ?? colors [ 0 ] ! ;
166+ const c1 = theme . tokens . graphics [ colors [ 1 ] ! ] ?? colors [ 1 ] ! ?? c0 ;
167+ const c2 = theme . tokens . graphics [ colors [ 2 ] ! ] ?? colors [ 2 ] ! ?? c1 ;
169168
170169 if ( frameCount === 1 ) {
171170 return `background: ${ c0 } ;` ;
@@ -190,7 +189,10 @@ const getBackgroundGradient = ({
190189 );` ;
191190} ;
192191
193- const IconNode = styled ( 'button' ) < { colors : Color [ ] ; frameCount : number } > `
192+ const IconNode = styled ( 'button' ) < {
193+ colors : Array < keyof Theme [ 'tokens' ] [ 'graphics' ] > ;
194+ frameCount : number ;
195+ } > `
194196 padding: 0;
195197 border: none;
196198 grid-column: 1;
0 commit comments