aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-06-26 22:16:30 -0700
committerPinapelz <yukais@pinapelz.com>2026-06-26 22:16:30 -0700
commit1a47e30a98bd9d4742197ec8df1b5633ca110c42 (patch)
treeba69280d404bfb03c9711c05bb94bdf187c63182
parentc8d13360d76116236ee9f476db8840b455930163 (diff)
add share button for daily mv mode
-rw-r--r--src/components/Result/index.tsx7
-rw-r--r--src/helpers/scoreToEmoji.ts7
-rw-r--r--src/react-app-env.d.ts1
3 files changed, 6 insertions, 9 deletions
diff --git a/src/components/Result/index.tsx b/src/components/Result/index.tsx
index 46959a6..21d1a1b 100644
--- a/src/components/Result/index.tsx
+++ b/src/components/Result/index.tsx
@@ -106,13 +106,6 @@ export function Result({
onPlayAgain,
}: Props) {
const [timeLeftStr, setTimeLeftStr] = useState<string>('');
- const now = new Date();
- const nextUtcMidnight = Date.UTC(
- now.getUTCFullYear(),
- now.getUTCMonth(),
- now.getUTCDate() + 1,
- 0, 0, 0
- );
React.useEffect(() => {
const updateTimeLeft = () => {
diff --git a/src/helpers/scoreToEmoji.ts b/src/helpers/scoreToEmoji.ts
index 4e0df54..fb71229 100644
--- a/src/helpers/scoreToEmoji.ts
+++ b/src/helpers/scoreToEmoji.ts
@@ -4,7 +4,7 @@ import { appName } from "../constants";
export async function scoreToEmoji(guesses: GuessType[]): Promise<string> {
const msInDay = 24 * 60 * 60 * 1000;
const today = new Date();
- const startDate = new Date(import.meta.env.VITE_START_DATE);
+ const startDate = new Date(import.meta.env.VITE_START_DATE || today.toISOString());
const currentPageUrl = window.location.href;
const index =
Math.floor(
@@ -19,7 +19,10 @@ export async function scoreToEmoji(guesses: GuessType[]): Promise<string> {
skip: "⬜",
empty: "⬛️",
};
- const prefix = `${appName} - #${index}`;
+ let prefix = `${appName} (Daily Heardle) - #${index}`;
+ if (currentPageUrl.endsWith("mv")) {
+ prefix = `${appName} (Daily MV) - #${index}`;
+ }
let scoreEmoji = "";
diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts
index ac88680..cfb4b82 100644
--- a/src/react-app-env.d.ts
+++ b/src/react-app-env.d.ts
@@ -5,6 +5,7 @@ declare global {
readonly VITE_CDN_URL?: string;
readonly VITE_HEARDLE_SALT?: string;
readonly VITE_HEARDLE_API_URL?: string;
+ readonly VITE_START_DATE?: string;
}
interface ImportMeta {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage