feat: add temporary Excalidraw+ promo (#3540)
* feat: add temporary Excalidraw+ promo * add seemingly required query params
This commit is contained in:
parent
bac76778ce
commit
286e9a1524
@ -52,7 +52,6 @@ import {
|
|||||||
} from "./data/localStorage";
|
} from "./data/localStorage";
|
||||||
import CustomStats from "./CustomStats";
|
import CustomStats from "./CustomStats";
|
||||||
import { RestoredDataState } from "../data/restore";
|
import { RestoredDataState } from "../data/restore";
|
||||||
import { GitHubCorner } from "./components/GitHubCorner";
|
|
||||||
|
|
||||||
const languageDetector = new LanguageDetector();
|
const languageDetector = new LanguageDetector();
|
||||||
languageDetector.init({
|
languageDetector.init({
|
||||||
@ -162,6 +161,20 @@ const initializeScene = async (opts: {
|
|||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const PlusLinkJSX = (
|
||||||
|
<p style={{ direction: "ltr", unicodeBidi: "embed" }}>
|
||||||
|
Introducing Excalidraw+
|
||||||
|
<br />
|
||||||
|
<a
|
||||||
|
href="https://plus.excalidraw.com/?utm_source=excalidraw&utm_medium=banner&utm_campaign=launch"
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
|
Try out now!
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
|
||||||
const ExcalidrawWrapper = () => {
|
const ExcalidrawWrapper = () => {
|
||||||
const [errorMessage, setErrorMessage] = useState("");
|
const [errorMessage, setErrorMessage] = useState("");
|
||||||
const currentLangCode = languageDetector.detect() || defaultLang.code;
|
const currentLangCode = languageDetector.detect() || defaultLang.code;
|
||||||
@ -294,8 +307,16 @@ const ExcalidrawWrapper = () => {
|
|||||||
const renderTopRight = useCallback(
|
const renderTopRight = useCallback(
|
||||||
(isMobile: boolean, appState: AppState) => {
|
(isMobile: boolean, appState: AppState) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div
|
||||||
<GitHubCorner theme={appState.theme} dir={document.dir} />
|
style={{
|
||||||
|
width: "24ch",
|
||||||
|
fontSize: "0.7em",
|
||||||
|
textAlign: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* <GitHubCorner theme={appState.theme} dir={document.dir} /> */}
|
||||||
|
{/* FIXME remove after 2021-05-20 */}
|
||||||
|
{PlusLinkJSX}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -315,11 +336,35 @@ const ExcalidrawWrapper = () => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
const isTinyDevice = window.innerWidth < 362;
|
||||||
return (
|
return (
|
||||||
<fieldset>
|
<div
|
||||||
<legend>{t("labels.language")}</legend>
|
style={{
|
||||||
{renderLanguageList()}
|
display: "flex",
|
||||||
</fieldset>
|
flexDirection: isTinyDevice ? "column" : "row",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{t("labels.language")}</legend>
|
||||||
|
{renderLanguageList()}
|
||||||
|
</fieldset>
|
||||||
|
{/* FIXME remove after 2021-05-20 */}
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: "24ch",
|
||||||
|
fontSize: "0.7em",
|
||||||
|
textAlign: "center",
|
||||||
|
marginTop: isTinyDevice ? 16 : undefined,
|
||||||
|
marginLeft: "auto",
|
||||||
|
marginRight: isTinyDevice ? "auto" : undefined,
|
||||||
|
padding: "4px 2px",
|
||||||
|
border: "1px dashed #aaa",
|
||||||
|
borderRadius: 12,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{PlusLinkJSX}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return renderLanguageList();
|
return renderLanguageList();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user