Re-add navbar buttons and add toast translations
This commit is contained in:
parent
476c65a82c
commit
26ff6820f0
4 changed files with 36 additions and 34 deletions
|
|
@ -33,6 +33,8 @@ function Clipboard(text) {
|
||||||
export function IframeHeader(props: { url: string }) {
|
export function IframeHeader(props: { url: string }) {
|
||||||
const localProxy = localStorage.getItem("proxy") || "automatic";
|
const localProxy = localStorage.getItem("proxy") || "automatic";
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const share = () => {
|
const share = () => {
|
||||||
let proxyFrame: ProxyFrame | null = document.getElementById(
|
let proxyFrame: ProxyFrame | null = document.getElementById(
|
||||||
"iframe"
|
"iframe"
|
||||||
|
|
@ -49,13 +51,12 @@ export function IframeHeader(props: { url: string }) {
|
||||||
location.origin + navigator.userAgent
|
location.origin + navigator.userAgent
|
||||||
).toString(CryptoJS.enc.Utf8);
|
).toString(CryptoJS.enc.Utf8);
|
||||||
Clipboard(decodedUrl);
|
Clipboard(decodedUrl);
|
||||||
toast("URL copied to clipboard!");
|
toast(t("clipboard"));
|
||||||
} else {
|
} else {
|
||||||
toast("Your proxy choice doesn't support sharing.");
|
toast("Your proxy choice doesn't support sharing.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [showPopout, setShowPopout] = useState(false);
|
const [showPopout, setShowPopout] = useState(false);
|
||||||
const [showFullScreen, setFullScreen] = useState(false);
|
const [showFullScreen, setFullScreen] = useState(false);
|
||||||
const [proxiedTitle, setProxiedTitle] = useState("");
|
const [proxiedTitle, setProxiedTitle] = useState("");
|
||||||
|
|
@ -107,37 +108,35 @@ export function IframeHeader(props: { url: string }) {
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/*<div className="flex flex-row items-center gap-3 md:gap-2">
|
|
||||||
<IoChevronBackSharp
|
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
|
||||||
onClick={() => {
|
|
||||||
const proxyFrame: ProxyFrame | null = document.getElementById(
|
|
||||||
"iframe"
|
|
||||||
) as ProxyFrame;
|
|
||||||
proxyFrame.contentWindow.history.back();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<IoReloadSharp
|
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:rotate-[360deg] hover:scale-110 hover:brightness-125"
|
|
||||||
onClick={() => {
|
|
||||||
const proxyFrame: ProxyFrame | null = document.getElementById(
|
|
||||||
"iframe"
|
|
||||||
) as ProxyFrame;
|
|
||||||
proxyFrame.contentWindow.location.reload();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<IoChevronForwardSharp
|
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
|
||||||
onClick={() => {
|
|
||||||
const proxyFrame: ProxyFrame | null = document.getElementById(
|
|
||||||
"iframe"
|
|
||||||
) as ProxyFrame;
|
|
||||||
proxyFrame.contentWindow.history.forward();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div> */}
|
|
||||||
<div id="navItems" className="w-1/8">
|
<div id="navItems" className="w-1/8">
|
||||||
<div className="mr-4 flex flex-row items-center justify-end gap-3">
|
<div className="mr-4 flex flex-row items-center justify-end gap-3">
|
||||||
|
<IoChevronBackSharp
|
||||||
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
||||||
|
onClick={() => {
|
||||||
|
const proxyFrame: ProxyFrame | null = document.getElementById(
|
||||||
|
"iframe"
|
||||||
|
) as ProxyFrame;
|
||||||
|
proxyFrame.contentWindow.history.back();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<IoChevronForwardSharp
|
||||||
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
||||||
|
onClick={() => {
|
||||||
|
const proxyFrame: ProxyFrame | null = document.getElementById(
|
||||||
|
"iframe"
|
||||||
|
) as ProxyFrame;
|
||||||
|
proxyFrame.contentWindow.history.forward();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<IoReloadSharp
|
||||||
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:rotate-[360deg] hover:scale-110 hover:brightness-125"
|
||||||
|
onClick={() => {
|
||||||
|
const proxyFrame: ProxyFrame | null = document.getElementById(
|
||||||
|
"iframe"
|
||||||
|
) as ProxyFrame;
|
||||||
|
proxyFrame.contentWindow.location.reload();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<FaShareAlt
|
<FaShareAlt
|
||||||
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
className="duration-0500 h-6 w-6 cursor-pointer text-navbar-text-color transition-all hover:scale-110 hover:brightness-125"
|
||||||
onClick={share}
|
onClick={share}
|
||||||
|
|
|
||||||
|
|
@ -74,5 +74,6 @@
|
||||||
"catppuccinMacchiato": "Catppuccin Macchiato",
|
"catppuccinMacchiato": "Catppuccin Macchiato",
|
||||||
"catppuccinFrappe": "Catppuccin Frappe",
|
"catppuccinFrappe": "Catppuccin Frappe",
|
||||||
"catppuccinLatte": "Catppuccin Latte"
|
"catppuccinLatte": "Catppuccin Latte"
|
||||||
}
|
},
|
||||||
|
"clipboard": "URL copied to clipboard!"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,5 +73,6 @@
|
||||||
"catppuccinMacchiato": "Catppuccin Macchiato",
|
"catppuccinMacchiato": "Catppuccin Macchiato",
|
||||||
"catppuccinFrappe": "Catppuccin Frappe",
|
"catppuccinFrappe": "Catppuccin Frappe",
|
||||||
"catppuccinLatte": "Catppuccin Latte"
|
"catppuccinLatte": "Catppuccin Latte"
|
||||||
}
|
},
|
||||||
|
"clipboard": "¡URL copiada al portapapeles!"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,5 +73,6 @@
|
||||||
"catppuccinMacchiato": "Catppuccin Macchiato",
|
"catppuccinMacchiato": "Catppuccin Macchiato",
|
||||||
"catppuccinFrappe": "Catppuccin Frappe",
|
"catppuccinFrappe": "Catppuccin Frappe",
|
||||||
"catppuccinLatte": "Catppuccin Latte"
|
"catppuccinLatte": "Catppuccin Latte"
|
||||||
}
|
},
|
||||||
|
"clipboard": "URL がクリップボードにコピーされました!"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue