forked from Koniverse/SubWallet-Extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/telegram-dev' into telegram-wallet
- Loading branch information
Showing
43 changed files
with
1,509 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build Telegram MiniApp Dev | ||
on: | ||
pull_request: | ||
branches: | ||
- telegram-dev | ||
|
||
push: | ||
branches: | ||
- telegram-dev | ||
|
||
jobs: | ||
master: | ||
if: "!startsWith(github.event.head_commit.message, '[CI Skip]')" | ||
name: Deploy Telegram MiniApp | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GH_AUTOMATION_TOKEN }} | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'yarn' | ||
- name: Build | ||
env: | ||
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }} | ||
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }} | ||
NFT_MINTING_HOST: ${{ secrets.NFT_MINTING_HOST }} | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
GAME_API_HOST: ${{ vars.API_DEV_SERVER }} | ||
TELEGRAM_WEBAPP_LINK: ${{ vars.TELEGRAM_WEBAPP_LINK }} | ||
run: | | ||
yarn install --immutable | grep -v 'YN0013' | ||
if [ ${{ github.ref_name }} == 'telegram-wallet' ]; then | ||
yarn run webapp:change-build-number | ||
fi | ||
yarn webapp:build | ||
- name: Publish to Cloudflare Pages | ||
id: cloudflare_deployment | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: ${{ vars.CLOUDFLARE_PAGES_PROJECT_NAME }} | ||
gitHubToken: ${{ secrets.GH_AUTOMATION_TOKEN }} | ||
branch: main | ||
directory: './packages/webapp/build' | ||
wranglerVersion: '3' | ||
- if: "github.ref_name == 'telegram-dev' && github.event_name == 'push'" | ||
name: Automation Bot | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Automation Bot | ||
author_email: [email protected] | ||
message: '[CI Skip] Auto increase webapp build number' | ||
- name: Notify to Discord | ||
uses: sarisia/actions-status-discord@v1 | ||
if: always() | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: ${{ job.status }} | ||
username: WebApp Worker | ||
title: ${{ github.workflow }} | ||
description: | | ||
The deployment is completed. | ||
- URL: ${{ steps.cloudflare_deployment.outputs.url }} | ||
- Alias: ${{ steps.cloudflare_deployment.outputs.alias }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,13 +49,6 @@ jobs: | |
branch: main | ||
directory: './packages/webapp/build' | ||
wranglerVersion: '3' | ||
- if: "github.ref_name == 'telegram-wallet' && github.event_name == 'push'" | ||
name: Automation Bot | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: Automation Bot | ||
author_email: [email protected] | ||
message: '[CI Skip] Auto increase webapp build number' | ||
- name: Notify to Discord | ||
uses: sarisia/actions-status-discord@v1 | ||
if: always() | ||
|
13 changes: 13 additions & 0 deletions
13
packages/extension-base/src/services/migration-service/scripts/BeforeKaruraCampaign.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import BaseMigrationJob from '@subwallet/extension-base/services/migration-service/Base'; | ||
|
||
export default class BeforeKaruraCampaign extends BaseMigrationJob { | ||
public override async run (): Promise<void> { | ||
const state = this.state; | ||
|
||
state.chainService.disableChain('goldberg_testnet'); | ||
await state.chainService.updateAssetSetting('karura-NATIVE-KAR', { visible: true }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 137 additions & 0 deletions
137
packages/extension-koni-ui/src/Popup/Home/Airdrop/AirdropDetail/About.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// Copyright 2019-2022 @subwallet/extension-koni-ui authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { AirdropCampaign } from '@subwallet/extension-koni-ui/connector/booka/types'; | ||
import useTranslation from '@subwallet/extension-koni-ui/hooks/common/useTranslation'; | ||
import { ThemeProps } from '@subwallet/extension-koni-ui/types'; | ||
import { Button, Icon } from '@subwallet/react-ui'; | ||
import CN from 'classnames'; | ||
import { TelegramLogo } from 'phosphor-react'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
type Props = ThemeProps & { | ||
airdropInfo: AirdropCampaign | ||
}; | ||
|
||
function Component ({ airdropInfo, className }: Props) { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div className={CN(className)}> | ||
<div className='__dynamic-content-wrapper'> | ||
{ | ||
airdropInfo.description && ( | ||
<div | ||
className={'__dynamic-content'} | ||
dangerouslySetInnerHTML={{ __html: airdropInfo.description }} | ||
/> | ||
) | ||
} | ||
</div> | ||
|
||
<div className='__divider' /> | ||
<div className='__content-footer'> | ||
<div className='__token-info'> | ||
<div className='__token-label'> | ||
{t('Token')}: | ||
</div> | ||
{/* <div className='__token-icon'></div> */} | ||
<div className='__token-symbol'> | ||
{airdropInfo.symbol} | ||
</div> | ||
</div> | ||
|
||
<div className='__content-footer-separator' /> | ||
|
||
<div className='__social-info'> | ||
<div className='__social-label'> | ||
{t('Social')}: | ||
</div> | ||
|
||
<Button | ||
icon={( | ||
<Icon | ||
customSize={'16px'} | ||
phosphorIcon={TelegramLogo} | ||
weight={'fill'} | ||
/> | ||
)} | ||
size='xs' | ||
type='ghost' | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const AirdropDetailAbout = styled(Component)<Props>(({ theme: { extendToken, token } }: Props) => { | ||
return ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
|
||
'.__dynamic-content-wrapper': { | ||
paddingLeft: token.padding, | ||
paddingRight: token.padding, | ||
overflow: 'auto', | ||
flex: 1 | ||
}, | ||
|
||
'.__dynamic-content': { | ||
'h2, h1': { | ||
lineHeight: token.lineHeightLG, | ||
color: token.colorTextDark1, | ||
fontWeight: token.headingFontWeight, | ||
fontSize: token.fontSizeLG, | ||
marginBottom: token.marginSM | ||
}, | ||
|
||
p: { | ||
lineHeight: token.lineHeight, | ||
color: token.colorTextDark2, | ||
fontSize: token.fontSize, | ||
marginBottom: token.marginSM | ||
} | ||
}, | ||
|
||
'.__divider': { | ||
backgroundColor: token.colorBgDivider, | ||
height: 1, | ||
marginLeft: token.margin, | ||
marginRight: token.margin | ||
}, | ||
|
||
'.__content-footer': { | ||
padding: token.padding, | ||
paddingTop: 3, | ||
paddingBottom: 7, | ||
display: 'flex', | ||
alignItems: 'center', | ||
fontSize: token.fontSize, | ||
lineHeight: token.lineHeight | ||
}, | ||
|
||
'.__token-info, .__social-info': { | ||
display: 'flex', | ||
alignItems: 'center' | ||
}, | ||
|
||
'.__token-label, .__social-label': { | ||
color: token.colorTextDark4 | ||
}, | ||
|
||
'.__token-symbol': { | ||
marginLeft: token.marginXXS, | ||
fontWeight: token.headingFontWeight | ||
}, | ||
|
||
'.__content-footer-separator': { | ||
backgroundColor: token.colorBgDivider, | ||
height: token.size, | ||
width: 1, | ||
marginLeft: token.margin, | ||
marginRight: token.margin | ||
} | ||
}); | ||
}); |
109 changes: 109 additions & 0 deletions
109
packages/extension-koni-ui/src/Popup/Home/Airdrop/AirdropDetail/Condition.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// Copyright 2019-2022 @subwallet/extension-koni-ui authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { AirdropCampaign } from '@subwallet/extension-koni-ui/connector/booka/types'; | ||
import useTranslation from '@subwallet/extension-koni-ui/hooks/common/useTranslation'; | ||
import { ThemeProps } from '@subwallet/extension-koni-ui/types'; | ||
import { customFormatDate } from '@subwallet/extension-koni-ui/utils'; | ||
import CN from 'classnames'; | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
type Props = ThemeProps & { | ||
airdropInfo: AirdropCampaign | ||
}; | ||
|
||
function Component ({ airdropInfo, className }: Props) { | ||
// @ts-ignore | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<div className={CN(className)}> | ||
{ | ||
airdropInfo.eligibilityList.map((item) => ( | ||
<div | ||
className={'__eligibility-item'} | ||
key={item.name} | ||
> | ||
<div className='__eligibility-item-name'> | ||
{item.name} | ||
</div> | ||
|
||
<div className='__eligibility-item-line'> | ||
<div className='__eligibility-item-line-label'>{t('Time')}</div> | ||
<div className='__eligibility-item-line-value __eligibility-item-date'> | ||
<span>{item.start ? customFormatDate(item.start, '#DD# #MMM#') : '__'}</span> | ||
<span>-</span> | ||
<span>{item.end ? customFormatDate(item.end, '#DD# #MMM#') : '__'}</span> | ||
</div> | ||
</div> | ||
<div className='__eligibility-item-line'> | ||
<div className='__eligibility-item-line-label'>{t('Method')}</div> | ||
<div className='__eligibility-item-line-value'>Raffle ({item.boxCount})</div> | ||
</div> | ||
|
||
<div className='__eligibility-item-note'> | ||
<span className='__eligibility-item-note-label'>{t('Note')}:</span> | ||
<span className='__eligibility-item-note-content'> | ||
{item.note || t('A player can win multiple type of rewards')} | ||
</span> | ||
</div> | ||
</div> | ||
)) | ||
} | ||
</div> | ||
); | ||
} | ||
|
||
export const AirdropDetailCondition = styled(Component)<Props>(({ theme: { extendToken, token } }: Props) => { | ||
return ({ | ||
marginBottom: token.margin, | ||
paddingLeft: token.padding, | ||
paddingRight: token.padding, | ||
|
||
'.__eligibility-item + .__eligibility-item:before': { | ||
content: '""', | ||
display: 'block', | ||
height: 1, | ||
backgroundColor: token.colorBgDivider, | ||
marginLeft: token.marginXS, | ||
marginRight: token.marginXS, | ||
marginBottom: token.marginSM, | ||
marginTop: token.marginSM | ||
}, | ||
|
||
'.__eligibility-item-name': { | ||
fontSize: token.fontSize, | ||
lineHeight: token.lineHeight, | ||
fontWeight: token.headingFontWeight, | ||
marginBottom: token.marginSM | ||
}, | ||
|
||
'.__eligibility-item-line': { | ||
display: 'flex', | ||
gap: token.sizeXS, | ||
alignItems: 'center', | ||
marginBottom: token.marginXS | ||
}, | ||
|
||
'.__eligibility-item-line-label': { | ||
lineHeight: '22px', | ||
borderRadius: 12, | ||
backgroundColor: token.colorPrimary, | ||
fontWeight: token.headingFontWeight, | ||
minWidth: 56, | ||
fontSize: 10, | ||
textAlign: 'center' | ||
}, | ||
|
||
'.__eligibility-item-note-label': { | ||
marginRight: token.marginXXS, | ||
fontWeight: token.headingFontWeight | ||
}, | ||
|
||
'.__eligibility-item-date': { | ||
display: 'flex', | ||
gap: token.sizeXXS | ||
} | ||
}); | ||
}); |
Oops, something went wrong.