From 5cf62a19187441734f1b733b595bc1987bca28b4 Mon Sep 17 00:00:00 2001 From: Li Yuxuan Date: Tue, 20 Feb 2024 22:47:37 +0800 Subject: [PATCH] Fix casing (#299) * Fix text casing * Fix more text casing * Remove newsletter sign up dialog * Change login logout to sign in and sign out. --- app/add-level/page.tsx | 4 +- app/layout.tsx | 2 - app/profile/page.tsx | 6 --- app/result/score-details-accordion.tsx | 16 +++---- components/custom/back-button.tsx | 2 +- .../custom/globals/login-error-dialog.tsx | 10 ++-- .../custom/globals/login-reminder-dialog.tsx | 10 ++-- .../custom/home/home-menu-button-array.tsx | 28 +++++------ components/custom/home/page-counter.tsx | 2 +- components/custom/info-button.tsx | 2 +- components/custom/level-card.tsx | 10 ++-- components/custom/pricing/pricing-card.tsx | 18 +++---- .../privacy/profile-privacy-settings-card.tsx | 4 +- .../custom/profile/profile-danger-zone.tsx | 8 ++-- .../profile/profile-subscription-card.tsx | 10 ++-- .../recent-games/profile-recent-game-card.tsx | 10 ++-- .../profile-recent-games-scroll-view.tsx | 4 +- .../profile-statistics-card-view.tsx | 22 ++++----- .../topics/profile-topic-scroll-view.tsx | 2 +- .../topics/profile-topics-card-view.tsx | 12 ++--- .../custom/results/results-summary-card.tsx | 6 +-- components/custom/side-menu.tsx | 20 ++++---- components/header/dev-toggle.tsx | 2 +- components/header/index.tsx | 47 ++++++++++++------- components/header/menu-button.tsx | 2 +- components/header/server/login.ts | 2 +- components/header/server/logout.ts | 2 +- components/header/theme-toggle.tsx | 6 +-- components/header/user-login-portal.tsx | 28 +++++------ lib/utils/routeUtils.ts | 22 ++++----- public/features/about.md | 27 ++++------- public/features/content.md | 26 +++++----- 32 files changed, 184 insertions(+), 188 deletions(-) diff --git a/app/add-level/page.tsx b/app/add-level/page.tsx index 46433dd4..cb694c29 100644 --- a/app/add-level/page.tsx +++ b/app/add-level/page.tsx @@ -440,8 +440,8 @@ const AddLevelPage = () => { - )} diff --git a/app/profile/page.tsx b/app/profile/page.tsx index 85cbd827..fd414bf6 100644 --- a/app/profile/page.tsx +++ b/app/profile/page.tsx @@ -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'; @@ -41,11 +40,6 @@ export default async function ProfilePage() { }> - diff --git a/app/result/score-details-accordion.tsx b/app/result/score-details-accordion.tsx index f6a722e8..176f483d 100644 --- a/app/result/score-details-accordion.tsx +++ b/app/result/score-details-accordion.tsx @@ -176,7 +176,7 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) { ), }, { - title: 'Total Score', + title: 'Total score', content: ( {getCalculatedScore( @@ -188,11 +188,11 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) { ), }, { - title: 'Total Time Taken', + title: 'Total time taken', content: {`${getCompletionSeconds(score.duration)} seconds`}, }, { - title: `Time Score (${timeMultiplier * 100}%)`, + title: `Time score (${timeMultiplier * 100}%)`, content: ( {`${calculateTimeScore(score.duration).toString()} x ${ timeMultiplier * 100 @@ -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: ( {`${score.ai_score.toFixed(2)} x ${promptMultiplier * 100}% = ${round( score.ai_score * promptMultiplier, @@ -213,19 +213,19 @@ export function ScoreDetailsAccordion(props: ScoreDetailsAccordionProps) { } if (score.taboo_words.length > 0) { items.push({ - title: 'Taboo Words', + title: 'Taboo words', content: {score.taboo_words.map(startCase).join(', ')}, }); } if (score.ai_score !== undefined) { items.push({ - title: 'AI Score', + title: 'AI score', content: {score.ai_score.toFixed(2)}, }); } if (score.ai_explanation !== undefined) { items.push({ - title: 'AI Evaluation', + title: 'AI evaluation', content: ( {!props.pro && } @@ -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: ( {props.pro && } diff --git a/components/custom/back-button.tsx b/components/custom/back-button.tsx index a499401b..6d463a36 100644 --- a/components/custom/back-button.tsx +++ b/components/custom/back-button.tsx @@ -13,7 +13,7 @@ export function BackButton({ customBackHref }: BackButtonProps) { const router = useRouter(); return ( { customBackHref ? router.push(customBackHref) : router.back(); }} diff --git a/components/custom/globals/login-error-dialog.tsx b/components/custom/globals/login-error-dialog.tsx index e05e895f..3d8ad1f9 100644 --- a/components/custom/globals/login-error-dialog.tsx +++ b/components/custom/globals/login-error-dialog.tsx @@ -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, @@ -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'); } }; @@ -69,7 +69,7 @@ export function LoginErrorDialog() { autoFocus onClick={() => { setAlertOpen(false); - void handleLogin(); + void handleSignIn(); }} > Try Again diff --git a/components/custom/globals/login-reminder-dialog.tsx b/components/custom/globals/login-reminder-dialog.tsx index 2be42be7..3fac0755 100644 --- a/components/custom/globals/login-reminder-dialog.tsx +++ b/components/custom/globals/login-reminder-dialog.tsx @@ -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, @@ -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'); } }; @@ -85,7 +85,7 @@ export default function LoginReminderDialog() { > {customCancelLabel} - + Login diff --git a/components/custom/home/home-menu-button-array.tsx b/components/custom/home/home-menu-button-array.tsx index e6f8a6f6..2c9d6df5 100644 --- a/components/custom/home/home-menu-button-array.tsx +++ b/components/custom/home/home-menu-button-array.tsx @@ -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'; @@ -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( () => [ { - key: 'log in', + key: 'sign in', // eslint-disable-next-line react/jsx-no-undef icon: , - 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: , - 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', @@ -72,7 +72,7 @@ export default function HomeMenuButtonArray() { { key: 'contribute a topic', icon: , - 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', @@ -82,7 +82,7 @@ export default function HomeMenuButtonArray() { { key: 'view pricing', icon: , - 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', @@ -92,7 +92,7 @@ export default function HomeMenuButtonArray() { { key: 'view my profile', icon: , - 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', @@ -102,7 +102,7 @@ export default function HomeMenuButtonArray() { { key: 'upgrade plan', icon: , - 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', @@ -111,7 +111,7 @@ export default function HomeMenuButtonArray() { { key: 'review topic and words', icon: , - 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', diff --git a/components/custom/home/page-counter.tsx b/components/custom/home/page-counter.tsx index 98fa50f7..14c3ed58 100644 --- a/components/custom/home/page-counter.tsx +++ b/components/custom/home/page-counter.tsx @@ -32,7 +32,7 @@ export default function PageCounter() { )} - Total Views:{' '} + Total views:{' '} {appStats?.app_views?.value ?? ( diff --git a/components/custom/info-button.tsx b/components/custom/info-button.tsx index c13a5eb4..b801536f 100644 --- a/components/custom/info-button.tsx +++ b/components/custom/info-button.tsx @@ -18,7 +18,7 @@ interface InfoButtonProps { export const InfoButton = ({ title, description, - tooltip = 'View Info', + tooltip = 'View info', className = '', size = 20, }: InfoButtonProps) => { diff --git a/components/custom/level-card.tsx b/components/custom/level-card.tsx index 699b75fc..78d87fcc 100644 --- a/components/custom/level-card.tsx +++ b/components/custom/level-card.tsx @@ -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 )} {level?.difficulty && ( @@ -121,16 +121,16 @@ export function LevelCard({ isShowingRank, level, allowedPlanType }: LevelCardPr
-
Best Score
+
Best score
{level.best_score.toFixed(2)}
{level?.top_scorer_names && (
{level.top_scorer_names.length > 1 ? ( -
by Top Scorers
+
by top scorers
) : ( -
by Top Scorer
+
by top scorer
)}
{level.top_scorer_names.join(' & ')}
@@ -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'} diff --git a/components/custom/pricing/pricing-card.tsx b/components/custom/pricing/pricing-card.tsx index 20681108..b01f4467 100644 --- a/components/custom/pricing/pricing-card.tsx +++ b/components/custom/pricing/pricing-card.tsx @@ -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'; } } @@ -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(); }, @@ -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', }); @@ -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: () => { diff --git a/components/custom/profile/privacy/profile-privacy-settings-card.tsx b/components/custom/profile/privacy/profile-privacy-settings-card.tsx index 0d3b0d6b..a77e1cb1 100644 --- a/components/custom/profile/privacy/profile-privacy-settings-card.tsx +++ b/components/custom/profile/privacy/profile-privacy-settings-card.tsx @@ -24,13 +24,13 @@ export function ProfilePrivacySettingsCard({ user, className }: ProfilePrivacySe - Privacy Settings + Privacy settings Control your privacy settings here.
{ try { diff --git a/components/custom/profile/profile-danger-zone.tsx b/components/custom/profile/profile-danger-zone.tsx index 31915f11..abcde34c 100644 --- a/components/custom/profile/profile-danger-zone.tsx +++ b/components/custom/profile/profile-danger-zone.tsx @@ -51,7 +51,7 @@ export function ProfileDangerZone(props: ProfileDangerZoneProps) { - Danger Zone + Danger zone Once you have deleted your account, there is no going back. All your data with us will @@ -59,7 +59,7 @@ export function ProfileDangerZone(props: ProfileDangerZoneProps) { Your active subscription will also be cancelled. However, your ongoing paid subscription (including trial) will still be available until the end of the billing - cycle when you log in with the same email account. + cycle when you sign in with the same email account. {' '} Please be certain. @@ -70,7 +70,7 @@ export function ProfileDangerZone(props: ProfileDangerZoneProps) { setIsConfirmOpen(true); }} > - Delete My Account + Delete my account @@ -91,7 +91,7 @@ export function ProfileDangerZone(props: ProfileDangerZoneProps) { Your current subscription will also be cancelled automatically. However, your ongoing subscription will still be available until the end of the billing cycle when - you log in with the same email account. + you sign in with the same email account. {' '} This action is irreversible. diff --git a/components/custom/profile/profile-subscription-card.tsx b/components/custom/profile/profile-subscription-card.tsx index 54568217..4d574ff7 100644 --- a/components/custom/profile/profile-subscription-card.tsx +++ b/components/custom/profile/profile-subscription-card.tsx @@ -182,7 +182,7 @@ export function ProfileSubscriptionCard({ user, className }: ProfileSubscription - My Subscription + My subscription Manage your subscription here. {user.subscription ? ( @@ -197,7 +197,7 @@ export function ProfileSubscriptionCard({ user, className }: ProfileSubscription {renderSubscriptionDetails(user.stripeSubscription?.status)}
{user.subscription.customer_id && ( - + )} {!userHasCancelledSubscription && ( <> @@ -210,8 +210,8 @@ export function ProfileSubscriptionCard({ user, className }: ProfileSubscription }} > {user.subscription?.customer_plan_type === 'free' - ? 'Upgrade My Plan' - : 'Change My Plan'} + ? 'Upgrade my plan' + : 'Change my plan'} {user.subscription?.customer_plan_type !== 'free' && ( )} diff --git a/components/custom/profile/recent-games/profile-recent-game-card.tsx b/components/custom/profile/recent-games/profile-recent-game-card.tsx index 9a87a6fc..51ce205d 100644 --- a/components/custom/profile/recent-games/profile-recent-game-card.tsx +++ b/components/custom/profile/recent-games/profile-recent-game-card.tsx @@ -50,20 +50,20 @@ export function ProfileRecentGameCard({ game }: ProfileRecentGameCardProps) { {getDifficulty(game.level_difficulty, false)}
- Total Time Taken: + Total time taken: {game.total_time_taken} seconds
- Total Score: + Total score: {game.total_score.toFixed(2)}
- Overall Ratings: + Overall ratings:
@@ -72,7 +72,7 @@ export function ProfileRecentGameCard({ game }: ProfileRecentGameCardProps) { - {game.game_id == 'play-more' ? 'Play More Topics' : 'View Results'} + {game.game_id == 'play-more' ? 'Play more topics' : 'View results'} ); diff --git a/components/custom/profile/recent-games/profile-recent-games-scroll-view.tsx b/components/custom/profile/recent-games/profile-recent-games-scroll-view.tsx index dc71d165..5cf02a36 100644 --- a/components/custom/profile/recent-games/profile-recent-games-scroll-view.tsx +++ b/components/custom/profile/recent-games/profile-recent-games-scroll-view.tsx @@ -17,7 +17,7 @@ export async function ProfileRecentGamesScrollView() { return (
-

Past Games

+

Past games

You can view most recent{' '} @@ -29,7 +29,7 @@ export async function ProfileRecentGamesScrollView() { To view more past games, upgrade to PRO plan:{' '} - Upgrade My Plan + Upgrade my plan )} diff --git a/components/custom/profile/statistics/profile-statistics-card-view.tsx b/components/custom/profile/statistics/profile-statistics-card-view.tsx index ac4f1b80..e4f21bcb 100644 --- a/components/custom/profile/statistics/profile-statistics-card-view.tsx +++ b/components/custom/profile/statistics/profile-statistics-card-view.tsx @@ -17,14 +17,14 @@ export async function ProfileStatisticsCardView() { - Game Statistics + Game statistics Upgrade to PRO plan to unlock your exclusive game statistics. Get more insights on your game performance and improve your game play! - + @@ -34,7 +34,7 @@ export async function ProfileStatisticsCardView() { return (
-

Game Statistics

+

Game statistics

)} @@ -57,32 +57,32 @@ export async function ProfileStatisticsCardView() { stats.mostFreqPlayedLevels.map((mostFreqPlayedTopic) => ( ))} {stats.highestScore && ( )} { const totalSeconds = stats.totalDurationSpent; const hours = Math.floor(totalSeconds / 3600); diff --git a/components/custom/profile/topics/profile-topic-scroll-view.tsx b/components/custom/profile/topics/profile-topic-scroll-view.tsx index f1cd2712..321a7db1 100644 --- a/components/custom/profile/topics/profile-topic-scroll-view.tsx +++ b/components/custom/profile/topics/profile-topic-scroll-view.tsx @@ -12,7 +12,7 @@ export async function ProfilePlayedTopicScrollView() { return (
-

Completed Topics

+

Completed topics

{playedTopics.length === 0 ? ( diff --git a/components/custom/profile/topics/profile-topics-card-view.tsx b/components/custom/profile/topics/profile-topics-card-view.tsx index ea7e9882..899b0f85 100644 --- a/components/custom/profile/topics/profile-topics-card-view.tsx +++ b/components/custom/profile/topics/profile-topics-card-view.tsx @@ -24,7 +24,7 @@ export function ProfileTopicsCardView({ topic }: ProfileTopicsCardViewProps) { - Play More Topics + Play more topics @@ -58,24 +58,24 @@ export function ProfileTopicsCardView({ topic }: ProfileTopicsCardViewProps) {
)}
- Best Score: + Best score: {topic.total_score.toFixed(2)}
- Best Rating: + Best rating:
{topic.is_best_score && (
- You are the Top Scorer for this topic! + You are the top scorer for this topic!
)} @@ -84,7 +84,7 @@ export function ProfileTopicsCardView({ topic }: ProfileTopicsCardViewProps) { )} - {topic.level_id === 'play-more' ? 'Play More Topics' : 'Play Again'} + {topic.level_id === 'play-more' ? 'Play more topics' : 'Play again'} ); diff --git a/components/custom/results/results-summary-card.tsx b/components/custom/results/results-summary-card.tsx index 382be046..a0654be3 100644 --- a/components/custom/results/results-summary-card.tsx +++ b/components/custom/results/results-summary-card.tsx @@ -37,11 +37,11 @@ export default function ResultsSummaryCard({
- Total Time Taken: + Total time taken: {total} seconds
- Total Score: + Total score:
{roundedTotalScore ? ( @@ -52,7 +52,7 @@ export default function ResultsSummaryCard({
- Overall Ratings: + Overall ratings: {rating ? ( ) : ( diff --git a/components/custom/side-menu.tsx b/components/custom/side-menu.tsx index 09411120..2f56b90a 100644 --- a/components/custom/side-menu.tsx +++ b/components/custom/side-menu.tsx @@ -10,7 +10,7 @@ import { BsDiscord } from 'react-icons/bs'; import { toast } from 'sonner'; import { feedback } from '@/components/custom/globals/generic-feedback-dialog'; -import { login } from '@/components/header/server/login'; +import { signIn } from '@/components/header/server/login'; import { Button } from '@/components/ui/button'; import { CustomEventKey, EventManager } from '@/lib/event-manager'; @@ -55,12 +55,12 @@ export default function SideMenu() { }); }, [isFocused, pathname]); - 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'); } }; @@ -91,11 +91,11 @@ export default function SideMenu() { 'Login to enjoy much more features! Contribute topics, personal profile, view game statistics, join rankings, and more!', visible: user === undefined, highlight: true, - onClick: handleLogin, + onClick: handleSignIn, }, { path: '/levels', - title: 'Choose A Topic', + title: 'Choose a topic', subtitle: 'Start playing Taboo AI by choosing any of the listed topic as you like. Can\'t find the topic you are looking for? Give "AI Mode" a try!', visible: true, @@ -103,7 +103,7 @@ export default function SideMenu() { }, { path: '/add-level', - title: 'Contribute A Topic', + title: 'Contribute a topic', subtitle: 'Be a contributor! Your creative topic will be played by all Taboo AI players around the world!', visible: true, @@ -111,7 +111,7 @@ export default function SideMenu() { }, { path: '/profile', - title: 'My Profile', + title: 'My profile', subtitle: 'Access your personalized profile here. Change your nickname, view past results, game statistics, manage privacy settings, delete your account...', visible: user !== undefined, @@ -154,14 +154,14 @@ export default function SideMenu() { }, { path: '/whatsnew', - title: 'Latest Features', + title: 'Latest features', subtitle: "Take a look at Taboo AI's latest features!", visible: true, href: '/whatsnew', }, { path: '/roadmap', - title: 'Project Roadmap', + title: 'Project roadmap', subtitle: 'Taboo AI has come a long way so far. Join me together to review the exciting journey!', visible: true, diff --git a/components/header/dev-toggle.tsx b/components/header/dev-toggle.tsx index 2566e61a..86d718f4 100644 --- a/components/header/dev-toggle.tsx +++ b/components/header/dev-toggle.tsx @@ -115,7 +115,7 @@ const DevToggle = () => { return user && user?.is_dev ? ( - + diff --git a/components/header/index.tsx b/components/header/index.tsx index 422def57..0b21697c 100644 --- a/components/header/index.tsx +++ b/components/header/index.tsx @@ -4,6 +4,7 @@ import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Home } from 'lucide-react'; +import { isMobile } from 'react-device-detect'; import { BackButton } from '@/components/custom/back-button'; import DevToggle from '@/components/header/dev-toggle'; @@ -70,22 +71,36 @@ export default function Header() { {!hideThemeToggle && } {!hideDevToggle && } -

- {title} - {pathname !== '/' && ( - - - - - - - Go to home - - )} -

+ {isMobile ? ( + +

+ {title} +

+ + ) : ( +

+ {title} + {pathname !== '/' && ( + + + + + + + Go to home + + )} +

+ )} {!hideUserMenu && } ); diff --git a/components/header/menu-button.tsx b/components/header/menu-button.tsx index b9c97cd4..1986afa0 100644 --- a/components/header/menu-button.tsx +++ b/components/header/menu-button.tsx @@ -9,7 +9,7 @@ import IconButton from '../ui/icon-button'; export function MenuButton() { return ( { EventManager.fireEvent(CustomEventKey.TOGGLE_MENU, true); }} diff --git a/components/header/server/login.ts b/components/header/server/login.ts index 4d2557b0..2e7855ec 100644 --- a/components/header/server/login.ts +++ b/components/header/server/login.ts @@ -1,6 +1,6 @@ import { createClient } from '@/lib/utils/supabase/client'; -export async function login() { +export async function signIn() { const supabaseClient = createClient(); const oauthResponse = await supabaseClient.auth.signInWithOAuth({ diff --git a/components/header/server/logout.ts b/components/header/server/logout.ts index 605d66ea..59dd5ab3 100644 --- a/components/header/server/logout.ts +++ b/components/header/server/logout.ts @@ -1,6 +1,6 @@ import { createClient } from '@/lib/utils/supabase/client'; -export async function logout() { +export async function signOut() { const supabaseClient = createClient(); const { error } = await supabaseClient.auth.signOut(); if (error) throw error; diff --git a/components/header/theme-toggle.tsx b/components/header/theme-toggle.tsx index d5604ca0..07f9eca3 100644 --- a/components/header/theme-toggle.tsx +++ b/components/header/theme-toggle.tsx @@ -9,11 +9,11 @@ export default function ThemeToggle() { const getToolTip = (theme: string | undefined): string => { switch (theme) { case 'light': - return 'Set to Dark Mode'; + return 'Set to dark mode'; case 'dark': - return 'Set to Follow System'; + return 'Set to follow system'; case 'system': - return 'Set to Light Mode'; + return 'Set to light mode'; default: return ''; } diff --git a/components/header/user-login-portal.tsx b/components/header/user-login-portal.tsx index 16a40746..f29c6fd5 100644 --- a/components/header/user-login-portal.tsx +++ b/components/header/user-login-portal.tsx @@ -17,8 +17,8 @@ import { toast } from 'sonner'; import { createStripeCustomerPortal } from '@/app/profile/server/create-stripe-customer-portal'; import { useAuth } from '@/components/auth-provider'; -import { login } from '@/components/header/server/login'; -import { logout } from '@/components/header/server/logout'; +import { signIn } from '@/components/header/server/login'; +import { signOut } from '@/components/header/server/logout'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; @@ -70,18 +70,18 @@ export function UserLoginPortal() { } }, [user]); - 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 handleLogout = async () => { + const handleSignOut = async () => { try { - await logout(); + await signOut(); toast(`Bye bye, ${user?.nickname ?? user?.name}! 👋`); hasGreeted = false; setTimeout(() => { @@ -110,14 +110,14 @@ export function UserLoginPortal() { const userMenuItems: UserMenuItem[] = useMemo(() => { return [ { - label: 'Manage Billing & Plan', + label: 'Manage billing & plan', icon: , isVisible: user?.subscription?.customer_id !== undefined && user?.subscription?.customer_id !== null, onClick: handleManageSubscription, }, { - label: 'Contribute A Topic', + label: 'Contribute a topic', icon: , isVisible: pathname !== '/add-level', onClick: () => { @@ -133,10 +133,10 @@ export function UserLoginPortal() { }, }, { - label: 'Logout', + label: 'Sign out', icon: , isVisible: true, - onClick: handleLogout, + onClick: handleSignOut, }, ]; }, [pathname, user]); @@ -247,14 +247,14 @@ export function UserLoginPortal() { ) : (
{shouldShowLoginIconWithLabel(pathname) ? ( - ) : ( - + )} diff --git a/lib/utils/routeUtils.ts b/lib/utils/routeUtils.ts index a6cc7ebc..bc24a8bc 100644 --- a/lib/utils/routeUtils.ts +++ b/lib/utils/routeUtils.ts @@ -35,17 +35,17 @@ export class RouteManager { }; case TabooPathname.ADD_LEVEL === route: return { - title: 'Contribute Topics', + title: 'Contribute topics', }; case TabooPathname.AI_MODE === route: return { - title: 'AI Generated Topic', + title: 'AI generated topic', hasBackButton: true, hideMenu: true, }; case TabooPathname.BUY_ME_COFFEE === route: return { - title: 'Buy Me A Coffee', + title: 'Buy me a coffee', }; case /^\/level\//.test(route): return { @@ -57,11 +57,11 @@ export class RouteManager { }; case TabooPathname.LEVELS === route: return { - title: 'Choose A Topic', + title: 'Choose a topic', }; case TabooPathname.RESULT === route: return { - title: 'Game Result', + title: 'Game result', hideDevToggle: false, }; case TabooPathname.PWA === route: @@ -74,11 +74,11 @@ export class RouteManager { }; case TabooPathname.RULE === route: return { - title: 'Taboo AI Game Rules', + title: 'Game rules', }; case TabooPathname.WHATSNEW === route: return { - title: 'New Features', + title: 'New features', }; case TabooPathname.ABOUT === route: return { @@ -86,7 +86,7 @@ export class RouteManager { }; case TabooPathname.X_REVIEW_WORDS === route: return { - title: 'Review Topics & Words', + title: 'Review topics', }; case TabooPathname.SITEMAP === route: return { @@ -94,7 +94,7 @@ export class RouteManager { }; case TabooPathname.PROFILE === route: return { - title: 'My Profile', + title: 'My profile', }; case TabooPathname.PRICING === route: return { @@ -103,7 +103,7 @@ export class RouteManager { }; case /^\/checkout\/success/.test(route): return { - title: 'Checkout Success', + title: 'Checkout success', }; case TabooPathname.PUBLICATIONS === route: return { @@ -111,7 +111,7 @@ export class RouteManager { }; case /^\/x\/review-words/.test(route): return { - title: 'Review Words', + title: 'Review words', hasBackButton: true, }; default: diff --git a/public/features/about.md b/public/features/about.md index 511061c1..0ca3057c 100644 --- a/public/features/about.md +++ b/public/features/about.md @@ -1,52 +1,41 @@ -# 🚀 Ignite Your English Learning with Taboo AI 🚀 +# 🚀 Ignite your English learning with Taboo AI 🚀 ![Taboo AI Poster](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/poster3.0(features).png?raw=true) -## **Taboo AI Classic Interface** +## **Taboo AI classic interface** ![1](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v300-1.png?raw=true) Say hello to a **sleek and intuitive interface** that makes navigating Taboo AI a breeze. Experience the charm of **classic typography** brought to life! Our new design invokes a sense of nostalgia while providing a seamless and intuitive experience. Enjoy a seamless and engaging experience from start to finish. -## **Dark/Light Mode** +## **Dark/Light mode** Tailor your gaming environment to suit your style. Whether you prefer a **dark** or **light** backdrop, Taboo AI now supports both modes for your convenience. -## **Dynamic Gameplay - Conversation** +## **Dynamic gameplay - Conversation** ![3](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v300-3.jpg?raw=true) Engage in "**conversation mode**" with the AI, turning your sessions into dynamic exchanges. No more one-question-one-answer routines. **Keep the conversation flowing** while cleverly coaxing out the 'taboo word'. 💬 -## **Detailed Results** +## **Detailed results** ![4](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v300-4.jpg?raw=true) The results page offers **comprehensive logs** of your conversations. **Save and share** your entire gaming session with friends to relive those memorable moments. 📊 -## **User Login and Authentication** - -For those eager to contribute topics, securely **log in with your Google account** (we will add in more platforms support in the later release!) and share your creative ideas with the Taboo AI community. 🔐 - -## **A Myraid of Topic for Selection** +## **A myraid of topics for selection** Finding your preferred topics has never been easier. **Sort by various criteria**, and see which topics are **most popular**. Discover what fellow players are diving into! 📚 If you can't find the topic you are looking for, head to the "AI Mode" to let AI help you! -## **Streamlined Menu** - -![2](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v300-2.png?raw=true) - -Everything you need is right at your fingertips. Navigate through **a comprehensive menu** (top left corner of the screen!) that covers every functionality Taboo AI has to offer. 🎮 - -## **Share Your High Scores! 🚀** +## **Share your high scores! 🚀** ![3](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3010-0.jpg?raw=true) -![4](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3010-2.png?raw=true) Want to show off your English talents? You can easily share your amazing results with your friends and the community at the Results page. Your clues are scored and rated and Taboo AI will generate a beautiful sharing card for your convenience! -## **Smart AI Feedbacks on Your Clues 👀** +## **Smart AI feedbacks on your clues 👀** ![5](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/smart-judge.png?raw=true) diff --git a/public/features/content.md b/public/features/content.md index 9ebdf012..dd51997b 100644 --- a/public/features/content.md +++ b/public/features/content.md @@ -1,8 +1,8 @@ -# 🥇 v3.1: Profile Page & Rankings 🏆 +# 🥇 v3.1: Profile page & rankings 🏆 -_new patch v3.1.6 on 04 Feb 2024_ +_new patch v3.1.7 on 20 Feb 2024_ -## Log in to access your profile 😎 +## Sign in to access your profile 😎 ![1](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-0-1.png?raw=true) @@ -10,28 +10,27 @@ You will be able to change your nickname, revisit past results and your game statistics. [check it out](/profile)! -**Profile Page** can be easily accessed from the side menu or top-right corner of the app, once you have signed in. +**Profile page** can be easily accessed from the side menu or top-right corner of the app, once you have signed in. -## Topic Rankings 🏆 +## Topic rankings 🏆 ![6](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-15-1.png?raw=true) ![7](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-15-2.png?raw=true) -If you go to the **Topics Page** ([Choose a topic](/levels)), you will find a new toggle switch on top that allows you -to toggle between the normal level view, or our **new ranking view**. In ranking mode, each topic will showcase the * -*Best Score** and the **Top Scorer**. However, take note that only logged-in user's result can be ranked. +If you go to the **Topics page** ([Choose a topic](/levels)), you will find a new toggle switch on top that allows you +to toggle between the normal level view, or our **new ranking view**. In ranking mode, each topic will showcase the **best score** and the **top scorer**. However, take note that only logged-in user's result can be ranked. ![8](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-1-3.png?raw=true) -## View Games You Played +## View games you played ![2](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-0-2.png?raw=true) We have updated our profile page for _signed in user_. Now you will be able to revisit the results of your past games played! [Head down to your profile](/profile) and find your past played games there! -## View Topics You Played +## View topics you played ![View topics](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-2-1.png?raw=true) @@ -39,7 +38,7 @@ You will also be able to view all the topics you have completed so far in your p page! [Head down to your profile](/profile) and see how you perform at each topic! If you are the **top scorer** of that topic, you will see a shining card indicating you are the **champion** 🏆. -## View Game Statistics +## View game statistics ![3](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-0-3.png?raw=true) @@ -48,19 +47,20 @@ topic, you will see a shining card indicating you are the **champion** 🏆. For _signed in PRO user_, you will also find your game statistics in your profile page. You can easily access topic to play again! [Go to profile page to find out more!](/profile) -## Privacy Settings +## Privacy settings ![9](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-1-4.png?raw=true) For _signed in user_, under profile, you can toggle some options related to your privacy. Currently, we support toggling "anonymity", which controls whether your nickname will be shown to others in the topic ranking screen. -## AI Evaluation with English Feedbacks +## AI evaluations and feedbacks ![5](https://github.com/xmliszt/resources/blob/main/taboo-ai/images/v300/v3-1-15-3.png?raw=true) With our improved AI using the latest AI model, you'll receive better feedbacks in the results page. The AI will assess your performance and provide you with a score, as well as a detailed feedback on your performance. + PRO user will also receive "AI Suggestions", which are suggested sample hints provided by our AI. We hope with this update, Taboo AI can take the next