Skip to content

Commit

Permalink
feat: dashboard access (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipndev authored Apr 10, 2024
1 parent f69c341 commit 26b8494
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,7 @@ const en: BaseTranslation = {
staticQr: "Printable Static QR Code",
staticQrCopied: "Your static QR code link has been copied",
setByOs: "Set by OS",
apiAcess: "API Access",
pos: "Point of Sale",
posCopied: "Your point of sale link has been copied",
setYourLightningAddress: "Set Your Lightning Address",
Expand Down
8 changes: 8 additions & 0 deletions app/i18n/i18n-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7176,6 +7176,10 @@ type RootTranslation = {
* S​e​t​ ​b​y​ ​O​S
*/
setByOs: string
/**
* A​P​I​ ​A​c​c​e​s​s
*/
apiAcess: string
/**
* P​o​i​n​t​ ​o​f​ ​S​a​l​e
*/
Expand Down Expand Up @@ -16177,6 +16181,10 @@ export type TranslationFunctions = {
* Set by OS
*/
setByOs: () => LocalizedString
/**
* API Access
*/
apiAcess: () => LocalizedString
/**
* Point of Sale
*/
Expand Down
1 change: 1 addition & 0 deletions app/i18n/raw-i18n/source/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,7 @@
"staticQr": "Printable Static QR Code",
"staticQrCopied": "Your static QR code link has been copied",
"setByOs": "Set by OS",
"apiAcess": "API Access",
"pos": "Point of Sale",
"posCopied": "Your point of sale link has been copied",
"setYourLightningAddress": "Set Your Lightning Address",
Expand Down
3 changes: 2 additions & 1 deletion app/screens/settings-screen/settings-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { AccountLNAddress } from "./settings/account-ln-address"
import { AccountPOS } from "./settings/account-pos"
import { AccountStaticQR } from "./settings/account-static-qr"
import { TxLimits } from "./settings/account-tx-limits"
import { ApiAccessSetting } from "./settings/advanced-api-access"
import { ExportCsvSetting } from "./settings/advanced-export-csv"
import { JoinCommunitySetting } from "./settings/community-join"
import { NeedHelpSetting } from "./settings/community-need-help"
Expand Down Expand Up @@ -74,7 +75,7 @@ export const SettingsScreen: React.FC = () => {
ThemeSetting,
],
securityAndPrivacy: [TotpSetting, OnDeviceSecuritySetting],
advanced: [ExportCsvSetting],
advanced: [ExportCsvSetting, ApiAccessSetting],
community: [NeedHelpSetting, JoinCommunitySetting],
}

Expand Down
25 changes: 25 additions & 0 deletions app/screens/settings-screen/settings/advanced-api-access.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Linking } from "react-native"

import { GaloyIcon } from "@app/components/atomic/galoy-icon"
import { useI18nContext } from "@app/i18n/i18n-react"

import { SettingsRow } from "../row"

const DASHBOARD_LINK = "https://dashboard.blink.sv"

export const ApiAccessSetting: React.FC = () => {
const { LL } = useI18nContext()

return (
<SettingsRow
title={LL.SettingsScreen.apiAcess()}
subtitle={DASHBOARD_LINK}
subtitleShorter={true}
leftIcon="code"
rightIcon={<GaloyIcon name="link" size={24} />}
action={() => {
Linking.openURL(DASHBOARD_LINK)
}}
/>
)
}

0 comments on commit 26b8494

Please sign in to comment.