mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
web: put the donation pill below the feedback button
The two floating buttons swap places: the Ko-fi pill now sits in the corner at bottom: 5.5rem and the feedback button stacks above it at 8.5rem, which keeps the same 12px gap the previous arrangement had. The offset still follows the instance rather than the dialog, it just moved to the other element: the feedback button only shifts up where the donation pill is actually rendered, and takes the corner spot where the build dropped it via VITE_DONATE_URL=. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
6ebc3e22e0
commit
0b34e7ecfb
2 files changed
+14
-18
No files matched your search
+9
-13
@@ -2053,7 +2053,7 @@ const FEEDBACK_BUBBLE_MIN_INTERVAL_MS = 3 * 24 * 60 * 60 * 1000; // don't nag mo
|
||||
const FEEDBACK_BUBBLE_INITIAL_DELAY_MS = 45_000;
|
||||
const FEEDBACK_BUBBLE_AUTO_HIDE_MS = 14_000;
|
||||
|
||||
function FeedbackFab({ onOpen }: { onOpen: () => void }) {
|
||||
function FeedbackFab({ onOpen, stacked }: { onOpen: () => void; stacked: boolean }) {
|
||||
const t = useT();
|
||||
const [bubbleVisible, setBubbleVisible] = useState(false);
|
||||
|
||||
@@ -2086,7 +2086,7 @@ function FeedbackFab({ onOpen }: { onOpen: () => void }) {
|
||||
}, [bubbleVisible]);
|
||||
|
||||
return (
|
||||
<div className="ts-feedback-fab-wrap">
|
||||
<div className={`ts-feedback-fab-wrap${stacked ? " ts-feedback-fab-wrap-stacked" : ""}`}>
|
||||
{bubbleVisible && (
|
||||
<div className="ts-feedback-bubble" onClick={onOpen}>
|
||||
<button
|
||||
@@ -2118,16 +2118,13 @@ function FeedbackFab({ onOpen }: { onOpen: () => void }) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Small donation pill, pinned above the feedback button (or in its place where
|
||||
* that one is not shown - see `stacked`).
|
||||
*/
|
||||
function DonateFab({ stacked }: { stacked: boolean }) {
|
||||
/** Small donation pill, pinned to the bottom right corner. */
|
||||
function DonateFab() {
|
||||
const t = useT();
|
||||
if (!DONATE_URL) return null;
|
||||
return (
|
||||
<a
|
||||
className={`ts-donate-fab${stacked ? " ts-donate-fab-stacked" : ""}`}
|
||||
className="ts-donate-fab"
|
||||
href={DONATE_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
@@ -9352,14 +9349,13 @@ function AppInner() {
|
||||
|
||||
<UpdatePrompt />
|
||||
|
||||
{/* The feedback button sits above the donation pill where that one is
|
||||
shown, and takes its spot where it is not. */}
|
||||
{IS_OWN_HOSTED_INSTANCE && !feedbackOpen && (
|
||||
<FeedbackFab onOpen={() => setFeedbackOpen(true)} />
|
||||
<FeedbackFab onOpen={() => setFeedbackOpen(true)} stacked={!!DONATE_URL} />
|
||||
)}
|
||||
|
||||
{/* Sits above the feedback button where that exists, and takes its spot
|
||||
where it does not - the offset follows the instance, not the dialog,
|
||||
so opening feedback does not make the pill jump. */}
|
||||
<DonateFab stacked={IS_OWN_HOSTED_INSTANCE} />
|
||||
<DonateFab />
|
||||
|
||||
{feedbackOpen && <FeedbackDialog onClose={() => setFeedbackOpen(false)} />}
|
||||
|
||||
|
||||
Reference in new issue
Block a user