Skip to content

Commit

Permalink
Fix casing (#299)
Browse files Browse the repository at this point in the history
* Fix text casing

* Fix more text casing

* Remove newsletter sign up dialog

* Change login logout to sign in and sign out.
  • Loading branch information
xmliszt authored Feb 20, 2024
1 parent 50231d5 commit 5cf62a1
Show file tree
Hide file tree
Showing 32 changed files with 184 additions and 188 deletions.
4 changes: 2 additions & 2 deletions app/add-level/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ const AddLevelPage = () => {
<span>
<InfoButton
size={15}
tooltip='Read About Taboo AI Content Policy'
title='Taboo AI Content Policy'
tooltip='Read about Taboo AI content policy'
title='Taboo AI content policy'
description='Taboo AI, our innovative web application, is designed to
ensure a safe and respectful user experience for everyone.
As part of our commitment to maintaining a positive online
Expand Down
2 changes: 0 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import React from 'react';

import GenericAlertDialog from '@/components/custom/globals/generic-alert-dialog';
import GenericFeedbackDialog from '@/components/custom/globals/generic-feedback-dialog';
import { NewsletterSignupDialog } from '@/components/custom/globals/newletter-signup-dialog';
import SubscriptionLockDialog from '@/components/custom/globals/subscription-lock-dialog';
import Header from '@/components/header';
import { ReactQueryProvider } from '@/components/query-provider';
Expand Down Expand Up @@ -78,7 +77,6 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<GenericAlertDialog />
<GenericFeedbackDialog />
<FeaturePopup />
<NewsletterSignupDialog />
</>
)}
<AnalyticsProvider />
Expand Down
6 changes: 0 additions & 6 deletions app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ProfileAlertInfo } from '@/app/profile/profile-alert-info';
import { ProfileFeedbackFloatingButton } from '@/app/profile/profile-feedback-floating-button';
import { ProfileScrollControl } from '@/app/profile/profile-scroll-control';
import { fetchUserProfileWithSubscription } from '@/app/profile/server/fetch-user-profile';
import { ConstructionBlock } from '@/components/custom/common/construction-block';
import { ProfilePrivacySettingsCard } from '@/components/custom/profile/privacy/profile-privacy-settings-card';
import { ProfileDangerZone } from '@/components/custom/profile/profile-danger-zone';
import { ProfileSubscriptionCard } from '@/components/custom/profile/profile-subscription-card';
Expand Down Expand Up @@ -41,11 +40,6 @@ export default async function ProfilePage() {
<Suspense fallback={<Skeleton className='h-[350px] w-full' numberOfRows={12} />}>
<ProfileStatisticsCardView />
</Suspense>
<ConstructionBlock
title='Flashcard under construction...'
description='You will soon be able to create your own flashcards with the words you have played, kickstart custom game from the flashcard, organize them into decks and share them with your friends...'
className='w-full max-w-[500px]'
/>
<ProfilePrivacySettingsCard className='w-full max-w-[500px]' user={user} />
<ProfileSubscriptionCard className='w-full max-w-[500px]' user={user} />
<ProfileDangerZone className='w-full max-w-[500px]' user={user} />
Expand Down
16 changes: 8 additions & 8 deletions app/result/score-details-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) {
),
},
{
title: 'Total Score',
title: 'Total score',
content: (
<span>
{getCalculatedScore(
Expand All @@ -188,11 +188,11 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) {
),
},
{
title: 'Total Time Taken',
title: 'Total time taken',
content: <span>{`${getCompletionSeconds(score.duration)} seconds`}</span>,
},
{
title: `Time Score (${timeMultiplier * 100}%)`,
title: `Time score (${timeMultiplier * 100}%)`,
content: (
<span>{`${calculateTimeScore(score.duration).toString()} x ${
timeMultiplier * 100
Expand All @@ -202,7 +202,7 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) {
];
if (score.ai_score !== undefined) {
items.push({
title: `Clue Score (${promptMultiplier * 100}%)`,
title: `Clue score (${promptMultiplier * 100}%)`,
content: (
<span>{`${score.ai_score.toFixed(2)} x ${promptMultiplier * 100}% = ${round(
score.ai_score * promptMultiplier,
Expand All @@ -213,19 +213,19 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) {
}
if (score.taboo_words.length > 0) {
items.push({
title: 'Taboo Words',
title: 'Taboo words',
content: <span>{score.taboo_words.map(startCase).join(', ')}</span>,
});
}
if (score.ai_score !== undefined) {
items.push({
title: 'AI Score',
title: 'AI score',
content: <span>{score.ai_score.toFixed(2)}</span>,
});
}
if (score.ai_explanation !== undefined) {
items.push({
title: 'AI Evaluation',
title: 'AI evaluation',
content: (
<span>
{!props.pro && <ResultsAiExplanationInfoDialog pro={props.pro} />}
Expand All @@ -236,7 +236,7 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) {
}
if (score.ai_suggestion && score.ai_suggestion.length > 0) {
items.push({
title: 'AI Suggestions',
title: 'AI suggestions',
content: (
<span>
{props.pro && <ResultsAiExplanationInfoDialog pro={props.pro} />}
Expand Down
2 changes: 1 addition & 1 deletion components/custom/back-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function BackButton({ customBackHref }: BackButtonProps) {
const router = useRouter();
return (
<IconButton
tooltip='Go Back'
tooltip='Go back'
onClick={() => {
customBackHref ? router.push(customBackHref) : router.back();
}}
Expand Down
10 changes: 5 additions & 5 deletions components/custom/globals/login-error-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';

import { login } from '@/components/header/server/login';
import { signIn } from '@/components/header/server/login';
import {
AlertDialog,
AlertDialogAction,
Expand Down Expand Up @@ -42,13 +42,13 @@ export function LoginErrorDialog() {
};
}, []);

const handleLogin = async () => {
const handleSignIn = async () => {
try {
await login();
await signIn();
redirectHref && router.push(redirectHref);
} catch (error) {
console.error(error);
toast.error('Something went wrong. Failed to log in');
toast.error('Something went wrong. Failed to sign in');
}
};

Expand All @@ -69,7 +69,7 @@ export function LoginErrorDialog() {
autoFocus
onClick={() => {
setAlertOpen(false);
void handleLogin();
void handleSignIn();
}}
>
Try Again
Expand Down
10 changes: 5 additions & 5 deletions components/custom/globals/login-reminder-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from 'react';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';

import { login } from '@/components/header/server/login';
import { signIn } from '@/components/header/server/login';
import {
AlertDialog,
AlertDialogAction,
Expand Down Expand Up @@ -55,13 +55,13 @@ export default function LoginReminderDialog() {
};
}, []);

const handleLogin = async () => {
const handleSignIn = async () => {
try {
await login();
await signIn();
redirectHref && router.push(redirectHref);
} catch (error) {
console.error(error);
toast.error('Something went wrong. Failed to log in');
toast.error('Something went wrong. Failed to sign in');
}
};

Expand All @@ -85,7 +85,7 @@ export default function LoginReminderDialog() {
>
{customCancelLabel}
</AlertDialogCancel>
<AlertDialogAction autoFocus onClick={handleLogin}>
<AlertDialogAction autoFocus onClick={handleSignIn}>
Login
</AlertDialogAction>
</AlertDialogFooter>
Expand Down
28 changes: 14 additions & 14 deletions components/custom/home/home-menu-button-array.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { toast } from 'sonner';

import { useAuth } from '@/components/auth-provider';
import { LoginReminderProps } from '@/components/custom/globals/login-reminder-dialog';
import { login } from '@/components/header/server/login';
import { signIn } from '@/components/header/server/login';
import { CustomEventKey, EventManager } from '@/lib/event-manager';

import { HomeMenuButton } from '../home-menu-button';
Expand Down Expand Up @@ -38,32 +38,32 @@ export default function HomeMenuButtonArray() {
}
};

const handleLogin = async () => {
const handleSignIn = async () => {
try {
await login();
await signIn();
} catch (error) {
console.error(error);
toast.error('Something went wrong. Failed to log in');
toast.error('Something went wrong. Failed to sign in');
}
};

const homeMenuButtonData = useMemo<HomeMenuButtonData[]>(
() => [
{
key: 'log in',
key: 'sign in',
// eslint-disable-next-line react/jsx-no-undef
icon: <CircleUser size={20} />,
title: 'Log In',
title: 'Sign in',
subtitle:
'Unlock personal profile, game history, join topic rankings, and contribute new topics!',
ariaLabel: 'Click to log in',
onClick: handleLogin,
ariaLabel: 'Click to sign in',
onClick: handleSignIn,
visible: user === undefined,
},
{
key: 'play a topic',
icon: <Quote size={20} />,
title: 'Choose A Topic',
title: 'Choose a topic',
subtitle: 'Start playing Taboo AI by choosing one topic that you like.',
ariaLabel: 'Click to choose a topic to start playing',
href: '/levels',
Expand All @@ -72,7 +72,7 @@ export default function HomeMenuButtonArray() {
{
key: 'contribute a topic',
icon: <PenSquare size={20} />,
title: 'Contribute New Topics',
title: 'Contribute new topics',
subtitle:
'Be a contributor! Your creative topic will be played by all Taboo AI players around the world!',
ariaLabel: 'Click to contribute a new topic to Taboo AI',
Expand All @@ -82,7 +82,7 @@ export default function HomeMenuButtonArray() {
{
key: 'view pricing',
icon: <BookMarked size={20} />,
title: 'Taboo AI Pricing',
title: 'Taboo AI pricing',
subtitle:
'Taboo AI offers both free and paid plans. Choose a plan that suits you the best! PRO plan offers more exclusive features, including AI Mode!',
ariaLabel: 'Click to upgrade your subscription',
Expand All @@ -92,7 +92,7 @@ export default function HomeMenuButtonArray() {
{
key: 'view my profile',
icon: <User size={20} />,
title: 'View My Profile',
title: 'View my profile',
subtitle:
'Access your game history, statistics, edit nickname, manage privacy settings, and more!',
ariaLabel: 'Click to visit your personal profile',
Expand All @@ -102,7 +102,7 @@ export default function HomeMenuButtonArray() {
{
key: 'upgrade plan',
icon: <BookPlus size={20} />,
title: 'Upgrade My Plan',
title: 'Upgrade my plan',
subtitle: 'Become a PRO. Upgrade your plan to enjoy more exclusive PRO features.',
ariaLabel: 'Click to upgrade your plan',
href: '/pricing',
Expand All @@ -111,7 +111,7 @@ export default function HomeMenuButtonArray() {
{
key: 'review topic and words',
icon: <View size={20} />,
title: 'Review Topics & Words',
title: 'Review topics & words',
subtitle: 'Review and verify topics and worlds submitted. Only available for admin!',
ariaLabel: 'Click to review topics as dev',
href: '/x/review-words',
Expand Down
2 changes: 1 addition & 1 deletion components/custom/home/page-counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function PageCounter() {
<ArrowUp size={16} className='absolute -right-4 -top-1 animate-ping-once' />
)}
<Badge>
Total Views:{' '}
Total views:{' '}
{appStats?.app_views?.value ?? (
<span className='ml-2'>
<Spinner size={10} />
Expand Down
2 changes: 1 addition & 1 deletion components/custom/info-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface InfoButtonProps {
export const InfoButton = ({
title,
description,
tooltip = 'View Info',
tooltip = 'View info',
className = '',
size = 20,
}: InfoButtonProps) => {
Expand Down
10 changes: 5 additions & 5 deletions components/custom/level-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function LevelCard({ isShowingRank, level, allowedPlanType }: LevelCardPr
variant='outline'
className='border-yellow-500 bg-secondary text-secondary-foreground'
>
New Level
New level
</Badge>
)}
{level?.difficulty && (
Expand Down Expand Up @@ -121,16 +121,16 @@ export function LevelCard({ isShowingRank, level, allowedPlanType }: LevelCardPr
<section className='flex flex-col items-center gap-4'>
<Medal size={25} />
<div className='flex flex-col items-center gap-2'>
<div>Best Score</div>
<div>Best score</div>
<div className='text-2xl font-extrabold'>{level.best_score.toFixed(2)}</div>
<StarRatingBar rating={getOverallRating(level.best_score, 6)} maxRating={6} />
</div>
{level?.top_scorer_names && (
<div className='flex flex-col items-center gap-2'>
{level.top_scorer_names.length > 1 ? (
<div className='italic'>by Top Scorers</div>
<div className='italic'>by top scorers</div>
) : (
<div className='italic'>by Top Scorer</div>
<div className='italic'>by top scorer</div>
)}
<div className='text-2xl font-extrabold'>{level.top_scorer_names.join(' & ')}</div>
</div>
Expand Down Expand Up @@ -194,7 +194,7 @@ export function LevelCard({ isShowingRank, level, allowedPlanType }: LevelCardPr
: 'group-hover/level-card:-translate-y-1/2 group-hover/level-card:scale-150'
)}
>
{!isAIMode ? DisplayUtils.getLevelName(level.name) : 'AI Mode'}
{!isAIMode ? DisplayUtils.getLevelName(level.name) : 'AI mode'}
</div>
</CardHeader>
<CardContent className='relative'>
Expand Down
18 changes: 9 additions & 9 deletions components/custom/pricing/pricing-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ function getPlanActionLabel(
customerPlanTier?: number
) {
if (!customerPlanType || !customerPlanTier) {
return plan.type === 'free' ? 'Current Plan' : 'Start Free Trial';
return plan.type === 'free' ? 'Current plan' : 'Start free trial';
}
// logged in
if (customerPlanType === plan.type) {
return 'Current Plan';
return 'Current plan';
}
if (customerPlanTier > plan.tier) {
return 'Downgrade Plan';
return 'Downgrade plan';
} else if (customerPlanTier < plan.tier) {
return 'Upgrade Plan';
return 'Upgrade plan';
} else {
return 'Start Free Trial';
return 'Start free trial';
}
}

Expand Down Expand Up @@ -106,9 +106,9 @@ export default function PricingCard({ index, plan, className }: PricingCardProps
// user is on active subscription and not cancelled, show downgrade dialogue
if (user?.stripeSubscription?.status === 'active') {
return confirmAlert({
title: 'Downgrade to FREE plan',
title: 'Downgrade to free plan',
description:
'Are you sure you want to downgrade to FREE plan? You will lose all the features of your current plan after your current subscription period ends. You will still have access to paid features until then.',
'Are you sure you want to downgrade to free plan? You will lose all the features of your current plan after your current subscription period ends. You will still have access to paid features until then.',
onConfirm: () => {
downgradeToFreePlan();
},
Expand All @@ -118,7 +118,7 @@ export default function PricingCard({ index, plan, className }: PricingCardProps
return confirmAlert({
title: 'You do not have an active paid subscription',
description:
'You do not have an active paid subscription. Once your current paid subscription ends, you will automatically switch to FREE plan.',
'You do not have an active paid subscription. Once your current paid subscription ends, you will automatically switch to free plan.',
hasConfirmButton: false,
cancelLabel: 'OK',
});
Expand Down Expand Up @@ -159,7 +159,7 @@ export default function PricingCard({ index, plan, className }: PricingCardProps
confirmAlert({
title: 'Your subscription has been cancelled',
description:
'You will still have access to paid features until your current subscription period ends. After that, you will automatically switch to FREE plan.',
'You will still have access to paid features until your current subscription period ends. After that, you will automatically switch to free plan.',
hasConfirmButton: false,
cancelLabel: 'OK',
onCancel: () => {
Expand Down
Loading

0 comments on commit 5cf62a1

Please sign in to comment.