Skip to content

Commit

Permalink
Feat/update theme styles (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
rustin01 authored Sep 3, 2024
1 parent 285516c commit b123805
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 32 deletions.
2 changes: 1 addition & 1 deletion apps/wallet/public/chain-icons/UNKNOWN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/public/token-icons/UNKNOWN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/public/token-icons/all.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const App: FC = observer(() => {
}, [isUserLoggedIn])

return (
<main className={twMerge('h-full', (hibitIdSession.isLoggedIn || !isDesktop) && 'max-w-[576px] mx-auto py-6 bg-base-200')}>
<main className={twMerge('h-full relative', (hibitIdSession.isLoggedIn || !isDesktop) && 'max-w-[576px] mx-auto py-6 bg-base-200')}>
{!ready && <PageLoading />}

{ready && (
Expand Down
16 changes: 16 additions & 0 deletions apps/wallet/src/apis/services/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ export class MnemonicManager {
return mnemonicContent;
}

public async updateAsync(oldVersion: number, oldMnemonicContent: string, newMnemonicContent: string): Promise<string> {
const publicKey = await GetPublicKeyAsync();
const key = publicKey.publicKeyBase64;
const encryptionManager = new EncryptionManager();
const encryptedOld = await encryptionManager.encrypt(key, oldMnemonicContent);
const encryptedNew = await encryptionManager.encrypt(key, newMnemonicContent);
await UpdateMnemonicAsync(new UpdateMnemonicInput({
aesKey: encryptedNew.encryptedAesKeyAndIvBase64,
oldMnemonicContent: encryptedOld.encryptedDataBase64,
oldVersion,
newMnemonicContent: encryptedNew.encryptedDataBase64,
newVersion: MnemonicVersion.V1RsaSha1Aes,
}))
return newMnemonicContent
}

public async getAsync(): Promise<GetMnemonicResult> {
const encryptionManager = new EncryptionManager();
const { publicKeyBase64, privateKeyBase64 } = await encryptionManager.generateKeys();
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/auth-logos/UNKNOWN.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/caret-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions apps/wallet/src/assets/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/external.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/right-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/setting.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/assets/trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/wallet/src/components/Toaster/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const HibitToastContainer: FC = () => {
)
}}
className="flex flex-col items-center gap-2 !top-[var(--toastify-toast-top)]"
toastClassName="!max-w-[284px] !min-h-[50px] !px-5 !py-0 !m-0 !gap-4 !items-center !bg-[#3E537C] !rounded-lg"
toastClassName="!max-w-[284px] !min-h-[50px] !px-5 !py-0 !m-0 !gap-4 !items-center !bg-base-300 !rounded-lg"
bodyClassName="!m-0 !p-0"
/>
)
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/pages/password/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const CreatePasswordPage: FC = observer(() => {

<PasswordWarnings />

<div className="w-full p-6 pt-4 fixed left-0 bottom-0 bg-base-200">
<div className="w-full p-6 pt-4 absolute left-0 bottom-0 bg-base-200">
<LoaderButton
className="btn btn-block btn-sm"
loading={submitMutation.isPending}
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/pages/password/reset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const ResetPasswordPage: FC = observer(() => {

<PasswordWarnings />

<div className="w-full p-6 pt-4 fixed left-0 bottom-0 bg-base-200">
<div className="w-full p-6 pt-4 absolute left-0 bottom-0 bg-base-200">
<LoaderButton
className="btn btn-block btn-sm"
loading={submitMutation.isPending}
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet/src/pages/password/verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const VerifyPasswordPage: FC = observer(() => {

<PasswordWarnings />

<div className="w-full p-6 pt-4 fixed left-0 bottom-0 bg-base-200">
<div className="w-full p-6 pt-4 absolute left-0 bottom-0 bg-base-200">
<LoaderButton
className="btn btn-block btn-sm"
type="submit"
Expand Down
12 changes: 5 additions & 7 deletions apps/wallet/src/stores/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,11 @@ export class HibitIdSession {
const newPwd = MD5(`${newPasswordRaw}${this.userId}`).toString()
const phrase = AES.decrypt(this._mnemonic.mnemonicContent, oldPwd).toString(enc.Utf8);
const encryptedContent = AES.encrypt(phrase, newPwd).toString()
await UpdateMnemonicAsync(new UpdateMnemonicInput({
aesKey: '', // TODO:
oldMnemonicContent: this._mnemonic.mnemonicContent,
oldVersion: 0, // TODO:
newMnemonicContent: encryptedContent,
newVersion: 0, // TODO:
}))
await MnemonicManager.instance.updateAsync(
this._mnemonic.version,
this._mnemonic.mnemonicContent,
encryptedContent,
)
await this.fetchMnemonic()
this._password = newPwd
}
Expand Down
4 changes: 0 additions & 4 deletions apps/wallet/src/utils/auth/providers/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,5 @@ export class TelegramAuthenticateProvider implements IAuthenticateProvider {
},
);
})

// const data = {"id":6910684932,"first_name":"Rustin","last_name":"Chi","auth_date":1722478423,"hash":"46b0a8a1cae9d379c96896546bf37b05b5e8c088c51da9feaa675b2b878c79ae"}
// const queryValue = objToQuery(data)
// window.location.href = `${AUTH_SERVER_URL}Telegram/WebLogin?${queryValue}&returnUrl=${encodeURIComponent(`${location.origin}`)}`
}
}
10 changes: 5 additions & 5 deletions apps/wallet/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import daisyui from 'daisyui'
const hibitDarkTheme = {
'primary': '#0099E5',
'secondary': '#14C394',
'accent': '#262D40', // for border
'neutral': '#5F7195',
'base-100': '#20263C',
'base-200': '#273049',
"base-300": '#354159',
'accent': '#2d3137', // for border
'neutral': '#848e9c',
'base-100': 'rgba(27, 29, 34, 1)',
'base-200': 'rgba(31, 35, 40, 1)',
"base-300": 'rgb(45, 49, 55)',
// "info": "#00b1d1",
success: '#14C394',
"warning": "#FFC349",
Expand Down

0 comments on commit b123805

Please sign in to comment.