Skip to content

Commit 566b718

Browse files
authored
Updated dark mode styles for stats overview (#24164)
ref https://linear.app/ghost/issue/PROD-1975/darkmode-table-title-issues - Added dark mode styles for data list - Added dark mode styles for top posts - Added dark mode styles for feature image placeholder - Added dark mode styles for sort button
1 parent b01c896 commit 566b718

File tree

12 files changed

+18
-17
lines changed

12 files changed

+18
-17
lines changed

apps/posts/src/views/PostAnalytics/Growth/components/GrowthSources.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export const GrowthSources: React.FC<SourcesCardProps> = ({
182182
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
183183
</SheetTrigger>
184184
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
185-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
185+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
186186
<SheetTitle>{sheetTitle}</SheetTitle>
187187
<SheetDescription>{sheetDescription}</SheetDescription>
188188
</SheetHeader>

apps/posts/src/views/PostAnalytics/Web/components/Locations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const Locations:React.FC<LocationsProps> = ({data, isLoading}) => {
114114
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
115115
</SheetTrigger>
116116
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
117-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
117+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
118118
<SheetTitle>Top locations</SheetTitle>
119119
<SheetDescription>Where are the readers of this post</SheetDescription>
120120
</SheetHeader>

apps/posts/src/views/PostAnalytics/Web/components/Sources.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const Sources: React.FC<SourcesCardProps> = ({
120120
if (tableOnly) {
121121
const limitedData = extendedData.slice(0, topSourcesLimit);
122122
const hasMore = extendedData.length > topSourcesLimit;
123-
123+
124124
return (
125125
<div>
126126
<SourcesTable
@@ -138,7 +138,7 @@ export const Sources: React.FC<SourcesCardProps> = ({
138138
</Button>
139139
</SheetTrigger>
140140
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
141-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
141+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
142142
<SheetTitle>Sources</SheetTitle>
143143
<SheetDescription>{cardDescription}</SheetDescription>
144144
</SheetHeader>
@@ -189,7 +189,7 @@ export const Sources: React.FC<SourcesCardProps> = ({
189189
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
190190
</SheetTrigger>
191191
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
192-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
192+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
193193
<SheetTitle>Sources</SheetTitle>
194194
<SheetDescription>{cardDescription}</SheetDescription>
195195
</SheetHeader>

apps/shade/src/components/ui/data-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const DataListBar = React.forwardRef<HTMLDivElement, DataListBarProps>(({childre
117117
return (
118118
<div
119119
ref={ref}
120-
className={cn('absolute inset-x-0 inset-y-1 z-0 origin-left rounded-[4px] bg-[#EFF5FB] group-hover/row:bg-[#BDE1FF] transition-all', className)}
120+
className={cn('absolute inset-x-0 inset-y-1 z-0 origin-left rounded-[4px] bg-[#EFF5FB] dark:bg-[#202B36] dark:group-hover/row:bg-[#213F5E] group-hover/row:bg-[#BDE1FF] transition-all', className)}
121121
{...props}
122122
>
123123
{children}

apps/stats/src/views/Stats/Growth/components/GrowthSources.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ export const GrowthSources: React.FC<GrowthSourcesProps> = ({
9191
const {data: globalData} = useGlobalData();
9292
const {data: mrrHistoryResponse} = useMrrHistory();
9393
const {appSettings} = useAppContext();
94-
94+
9595
// Use external sort state if provided, otherwise use internal state
9696
const [internalSortBy, setInternalSortBy] = useState<SourcesOrder>('free_members desc');
9797
const sortBy = externalSortBy || internalSortBy;
9898
const setSortBy = externalSetSortBy || setInternalSortBy;
9999

100100
// Convert our sort format to backend format
101101
const backendOrderBy = sortBy.replace('free_members', 'signups').replace('paid_members', 'paid_conversions');
102-
102+
103103
// Use the new endpoint with server-side sorting and limiting
104104
const {data: referrersData, isLoading} = useTopSourcesGrowth(range, backendOrderBy, limit);
105105

@@ -146,7 +146,7 @@ export const GrowthSources: React.FC<GrowthSourcesProps> = ({
146146
return {
147147
source,
148148
free_members: item.signups, // Backend returns 'signups', we map to 'free_members' for display
149-
paid_members: item.paid_conversions, // Backend returns 'paid_conversions', we map to 'paid_members' for display
149+
paid_members: item.paid_conversions, // Backend returns 'paid_conversions', we map to 'paid_members' for display
150150
mrr: item.mrr,
151151
iconSrc,
152152
displayName: source,
@@ -232,7 +232,7 @@ export const GrowthSources: React.FC<GrowthSourcesProps> = ({
232232
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
233233
</SheetTrigger>
234234
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
235-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
235+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
236236
<SheetTitle>{title}</SheetTitle>
237237
<SheetDescription>{description}</SheetDescription>
238238
</SheetHeader>

apps/stats/src/views/Stats/Overview/components/TopPosts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const PostListTooltip:React.FC<PostlistTooptipProps> = ({
3030
<div className="flex flex-col gap-1.5">
3131
{metrics?.map(metric => (
3232
<div key={metric.label} className="flex items-center justify-between gap-5">
33-
<div className="flex items-center gap-1 whitespace-nowrap">
33+
<div className="flex items-center gap-1.5 whitespace-nowrap">
3434
{metric.icon}
3535
{metric.label}
3636
</div>
@@ -82,7 +82,7 @@ const TopPosts: React.FC<TopPostsProps> = ({
8282
{
8383
topPostsData?.stats?.map((post: TopPostViewsStats) => {
8484
return (
85-
<div className='group relative flex w-full items-start justify-between gap-5 border-t border-border/50 py-4 before:absolute before:-inset-x-4 before:inset-y-0 before:z-0 before:hidden before:rounded-md before:bg-accent before:opacity-80 before:content-[""] first:!border-border hover:cursor-pointer hover:border-transparent hover:before:block md:items-center [&+div]:hover:border-transparent' onClick={() => {
85+
<div className='group relative flex w-full items-start justify-between gap-5 border-t border-border/50 py-4 before:absolute before:-inset-x-4 before:inset-y-0 before:z-0 before:hidden before:rounded-md before:bg-accent before:opacity-80 before:content-[""] first:!border-border hover:cursor-pointer hover:border-transparent hover:before:block md:items-center dark:before:bg-accent/50 [&+div]:hover:border-transparent' onClick={() => {
8686
navigate(`/posts/analytics/beta/${post.post_id}`, {crossApp: true});
8787
}}>
8888
<div className='z-10 flex min-w-[160px] grow items-start gap-4 md:items-center lg:min-w-[320px]'>

apps/stats/src/views/Stats/Web/components/SourcesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const SourcesCard: React.FC<SourcesCardProps> = ({
157157
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
158158
</SheetTrigger>
159159
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
160-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
160+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
161161
<SheetTitle>{title}</SheetTitle>
162162
<SheetDescription>{description}</SheetDescription>
163163
</SheetHeader>

apps/stats/src/views/Stats/Web/components/TopContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const TopContent: React.FC<TopContentProps> = ({range}) => {
186186
<Button variant='outline'>View all <LucideIcon.TableOfContents /></Button>
187187
</SheetTrigger>
188188
<SheetContent className='overflow-y-auto pt-0 sm:max-w-[600px]'>
189-
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-white/60 p-6 backdrop-blur'>
189+
<SheetHeader className='sticky top-0 z-40 -mx-6 bg-background/60 p-6 backdrop-blur'>
190190
<SheetTitle>Top content</SheetTitle>
191191
<SheetDescription>{getContentDescription(selectedContentType, range, getPeriodText)}</SheetDescription>
192192
</SheetHeader>

apps/stats/src/views/Stats/components/FeatureImagePlaceholder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const FeatureImagePlaceholder:React.FC<FeatureImagePlaceholderProps> = ({
99
className
1010
}) => {
1111
return (
12-
<div className={cn('rounded-sm bg-muted flex flex-col items-stretch justify-center gap-1', className)}>
12+
<div className={cn('rounded-sm bg-muted dark:bg-[#36373a] flex flex-col items-stretch justify-center gap-1', className)}>
1313
<div className='flex flex-col items-stretch gap-[5px] px-[15%]'>
1414
<div className='h-[3px] bg-muted-foreground/20'></div>
1515
<div className='h-[3px] w-[80%] bg-muted-foreground/20'></div>

apps/stats/src/views/Stats/components/SortButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const SortButton = <T extends string>({
1616
}: SortButtonProps<T>) => {
1717
return (
1818
<TableHeadButton
19-
className={`${sortBy === activeSortBy && 'text-black'}`}
19+
className={`${sortBy === activeSortBy && 'text-foreground'}`}
2020
onClick={() => {
2121
setSortBy(sortBy);
2222
}}

0 commit comments

Comments
 (0)