diff --git a/packages/app/config/index.js b/packages/app/config/index.js index 68208d89..d0d566d6 100755 --- a/packages/app/config/index.js +++ b/packages/app/config/index.js @@ -37,7 +37,19 @@ export default { }, { label: "Support this project", - url: "https://www.paypal.com/donate/?hosted_button_id=S4TWMAN79KC76" + url: "https://ko-fi.com/comty" + } + ], + donatives: [ + { + name: "PayPal", + href: "https://www.paypal.com/donate/?hosted_button_id=S4TWMAN79KC76", + icon: "https://raw.githubusercontent.com/andreostrovsky/donate-with-paypal/master/dark.svg" + }, + { + name: "Ko-Fi", + href: "https://ko-fi.com/comty", + icon: "https://cdn.ko-fi.com/cdn/kofi3.png?v=3", } ], logo: { diff --git a/packages/app/src/components/BetaBanner/index.jsx b/packages/app/src/components/BetaBanner/index.jsx new file mode 100644 index 00000000..4b993d5f --- /dev/null +++ b/packages/app/src/components/BetaBanner/index.jsx @@ -0,0 +1,65 @@ +import React from "react" +import { Alert, Button } from "antd" +import { Translation } from "react-i18next" + +import DonativeSelector from "@components/DonativeSelector" + +import Config from "@config" + +import "./index.less" + +const BetaBanner = () => { + const [closed, setClosed] = React.useState(false) + + function openDonativeSelector() { + setClosed(true) + + app.layout.modal.open("donate", DonativeSelector, { + closable: true, + }) + } + + function setAsViewed() { + localStorage.setItem("welcome_beta", true) + setClosed(true) + } + + if (localStorage.getItem("welcome_beta") === true || closed) { + return null + } + + return
+ +
+

🎉 {t => t("Welcome to")} {Config.app.siteName} Beta

+
+ +
+

{t => t("We're glad to have you here, we hope you enjoy the first public beta.")}

+

{t => t("You can help us continue to improve the platform by supporting us with donations.")}

+
+ +
+ + + +
+
} + /> + +} + +export default BetaBanner \ No newline at end of file diff --git a/packages/app/src/components/BetaBanner/index.less b/packages/app/src/components/BetaBanner/index.less new file mode 100644 index 00000000..d5a35fbf --- /dev/null +++ b/packages/app/src/components/BetaBanner/index.less @@ -0,0 +1,36 @@ +.beta-banner-wrapper { + position: fixed; + + bottom: 0; + right: 0; + + z-index: 1000; + + width: fit-content; + + display: flex; + flex-direction: column; + + align-items: center; + justify-content: center; + + padding: 10px; + + .welcome-beta-banner { + display: flex; + flex-direction: column; + + gap: 10px; + + .welcome-beta-banner-title {} + + .welcome-beta-banner-content {} + + .welcome-beta-banner-actions { + display: inline-flex; + flex-direction: row; + + gap: 10px; + } + } +} \ No newline at end of file diff --git a/packages/app/src/components/DonativeSelector/index.jsx b/packages/app/src/components/DonativeSelector/index.jsx new file mode 100644 index 00000000..ebe95873 --- /dev/null +++ b/packages/app/src/components/DonativeSelector/index.jsx @@ -0,0 +1,35 @@ +import React from "react" +import { Translation } from "react-i18next" + +import Config from "@config" + +import "./index.less" + +const DonativeSelector = () => { + return
+

✨{t => t("Support us to continue improving ")}{Config.app.siteName}!✨

+

{t => t("Your contribution will help us continue to develop new features and improve our platform experience.")}

+

{t => t("Every donation, no matter how small, makes a difference and allows us to continue building a stronger community.")}

+ +
+ { + Config.donatives.map((channel) => { + return + {channel.name} + + }) + } +
+
+} + + +export default DonativeSelector \ No newline at end of file diff --git a/packages/app/src/components/DonativeSelector/index.less b/packages/app/src/components/DonativeSelector/index.less new file mode 100644 index 00000000..75083bcd --- /dev/null +++ b/packages/app/src/components/DonativeSelector/index.less @@ -0,0 +1,21 @@ +.donative-selector { + display: flex; + flex-direction: column; + + gap: 20px; + + .donative-selector_channels { + display: flex; + flex-direction: row; + + align-items: center; + justify-content: center; + + gap: 30px; + + img { + width: fit-content; + height: 40px; + } + } +} \ No newline at end of file diff --git a/packages/app/src/layouts/default/index.jsx b/packages/app/src/layouts/default/index.jsx index 5801d860..4e7c33b8 100755 --- a/packages/app/src/layouts/default/index.jsx +++ b/packages/app/src/layouts/default/index.jsx @@ -1,12 +1,14 @@ import React from "react" import classnames from "classnames" -import { Layout } from "antd" +import { Layout, Alert } from "antd" import Sidebar from "@layouts/components/sidebar" import ToolsBar from "@layouts/components/toolsBar" import Header from "@layouts/components/header" import Modals from "@layouts/components/modals" +import BetaBanner from "@components/BetaBanner" + // mobile components import { DraggableDrawerController } from "@layouts/components/draggableDrawer" import BottomBar from "@layouts/components/@mobile/bottomBar" @@ -36,8 +38,11 @@ const DesktopLayout = (props) => { props.children && React.cloneElement(props.children, props) } + + + }