Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channel link button in settings #33

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VITE_BOT_USERNAME=TeleOTPAppBot
VITE_PLAUSIBLE_DOMAIN=teleotp.pages.dev
VITE_PLAUSIBLE_API_HOST=https://analytics.gesti.tech
VITE_PLAUSIBLE_API_HOST=https://analytics.gesti.tech
VITE_CHANNEL_LINK=https://t.me/teleotpapp
49 changes: 37 additions & 12 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
import FileDownloadOutlinedIcon from '@mui/icons-material/FileDownloadOutlined';
import FingerprintIcon from '@mui/icons-material/Fingerprint';
import {SvgIconComponent} from "@mui/icons-material";
import {Newspaper,SvgIconComponent} from "@mui/icons-material";
import {useNavigate} from "react-router-dom";
import {SettingsManagerContext} from "../managers/settings.tsx";
import useTelegramHaptics from "../hooks/telegram/useTelegramHaptics.ts";
Expand Down Expand Up @@ -68,16 +68,41 @@ const Settings: FC = () => {
const encryptionManager = useContext(EncryptionManagerContext);
const settingsManager = useContext(SettingsManagerContext);
const analytics = useContext(PlausibleAnalyticsContext);
return (
<Stack spacing={1}>
<Typography
fontWeight="800"
color="primary"
fontSize="small"
sx={{ paddingY: theme.spacing(0.5) }}
>
General
</Typography>
<SettingsOption
onClick={() => {
window.Telegram.WebApp.openTelegramLink(import.meta.env.VITE_CHANNEL_LINK);
}}
text="TeleOTP News"
value="Open"
icon={Newspaper}
/>

return <Stack spacing={1}>
<Typography fontWeight="800" color="primary" fontSize="small" sx={{paddingY: theme.spacing(0.5)}}>
Security
</Typography>
<SettingsOption
onClick={() => { navigate("/changePassword"); }}
text="Password"
value="Change"
icon={LockOutlinedIcon}/>
<Typography
fontWeight="800"
color="primary"
fontSize="small"
sx={{ paddingY: theme.spacing(0.5) }}
>
Security
</Typography>
<SettingsOption
onClick={() => {
navigate("/changePassword");
}}
text="Password"
value="Change"
icon={LockOutlinedIcon}
/>

<SettingsOption
onClick={() => {
Expand Down Expand Up @@ -140,7 +165,7 @@ const Settings: FC = () => {
GitHub repository
</Link>
</Typography>
</Stack>
</Stack>);
}

export default Settings;
export default Settings;
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare const APP_HOMEPAGE: string;

interface ImportMetaEnv {
readonly VITE_BOT_USERNAME: string;
readonly VITE_CHANNEL_LINK: string;
readonly VITE_PLAUSIBLE_API_HOST: string;
readonly VITE_PLAUSIBLE_DOMAIN: string;
}
Expand Down