Skip to content

Commit

Permalink
Merge branch 'main' into refactor/dumiantdtheme
Browse files Browse the repository at this point in the history
  • Loading branch information
gin-lsl authored Feb 18, 2025
2 parents c2b6ada + 24a29bc commit 9e41827
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 19 deletions.
48 changes: 31 additions & 17 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Preview Deploy

on:
workflow_run:
workflows: ["Preview Build"]
workflows: ['Preview Build']
types:
- completed

Expand All @@ -14,14 +14,14 @@ permissions:
jobs:
deploy-site:
permissions:
actions: read # for dawidd6/action-download-artifact to query and download artifacts
issues: write # for actions-cool/maintain-one-comment to modify or create issue comments
pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments
actions: read # for dawidd6/action-download-artifact to query and download artifacts
issues: write # for actions-cool/maintain-one-comment to modify or create issue comments
pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments
name: deploy preview
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
# We need get PR id first
- name: download pr artifact
Expand All @@ -31,10 +31,16 @@ jobs:
run_id: ${{ github.event.workflow_run.id }}
name: pr

# Save PR id to output
# Save PR id to output and validate it's a number
- name: save PR id
id: pr
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
run: |
PR_ID=$(cat pr-id.txt)
if ! [[ "$PR_ID" =~ ^[0-9]+$ ]]; then
echo "Invalid PR ID: Not a number"
exit 1
fi
echo "id=$PR_ID" >> $GITHUB_OUTPUT
# Download site artifact
- name: download site artifact
Expand All @@ -46,9 +52,11 @@ jobs:

- name: upload surge service
id: deploy
env:
PR_ID: ${{ steps.pr.outputs.id }}
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.pr.outputs.id }}-ant-design-web3.surge.sh
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
DEPLOY_DOMAIN="https://preview-${PR_ID}-ant-design-web3.surge.sh"
npx surge --project ./ --domain "${DEPLOY_DOMAIN}" --token ${{ secrets.SURGE_TOKEN }}
- name: update status comment
uses: actions-cool/maintain-one-comment@v3
Expand All @@ -73,14 +81,14 @@ jobs:

build-site-failed:
permissions:
actions: read # for dawidd6/action-download-artifact to query and download artifacts
issues: write # for actions-cool/maintain-one-comment to modify or create issue comments
pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments
actions: read # for dawidd6/action-download-artifact to query and download artifacts
issues: write # for actions-cool/maintain-one-comment to modify or create issue comments
pull-requests: write # for actions-cool/maintain-one-comment to modify or create PR comments
name: build preview failed
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure'
steps:
# We need get PR id first
- name: download pr artifact
Expand All @@ -90,10 +98,16 @@ jobs:
run_id: ${{ github.event.workflow_run.id }}
name: pr

# Save PR id to output
# Save PR id to output and validate it's a number
- name: save PR id
id: pr
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
run: |
PR_ID=$(cat pr-id.txt)
if ! [[ "$PR_ID" =~ ^[0-9]+$ ]]; then
echo "Invalid PR ID: Not a number"
exit 1
fi
echo "id=$PR_ID" >> $GITHUB_OUTPUT
- name: The job has failed
uses: actions-cool/maintain-one-comment@v3
Expand Down
41 changes: 40 additions & 1 deletion docs/guide/demos/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import type { Web3ThemeConfig } from '@ant-design/web3';
import { theme } from 'antd';

export type ThemeValue = 'default' | 'violet' | 'dark' | 'green' | 'pink' | 'retro' | 'win95';
export type ThemeValue =
| 'default'
| 'violet'
| 'dark'
| 'green'
| 'pink'
| 'retro'
| 'win95'
| 'material';

export const customToken: Web3ThemeConfig = {
token: {
Expand Down Expand Up @@ -160,6 +168,37 @@ export const themeList: ThemeSetting[] = [
},
},
},
{
color: '#6750A4',
value: 'material',
name: 'Material Design 3',
buttonType: 'primary',
token: {
token: {
colorPrimary: '#6750a4',
colorBorderBg: '',
colorLink: '#6750a4',
colorBgBase: '#fdfbff',
colorBgContainer: '#fdfbff',
colorBgMask: 'rgba(0, 0, 0, 0.32)',
controlHeight: 40,
},
components: {
Button: {
colorBorder: 'transparent',
colorText: '#6750a4',
colorPrimaryBg: '#6750a4',
primaryShadow: 'none',
dangerShadow: 'none',
defaultShadow: 'none',
},
Modal: {
contentBg: '#fffbfe',
boxShadow: 'none',
},
},
},
},
{
value: 'green',
name: 'Forest green',
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/demos/try-it-out/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const App: React.FC = () => {
}}
defaultValue={defaultRadius}
min={0}
max={16}
max={24}
onChange={setRadius}
/>
</Space>
Expand Down

0 comments on commit 9e41827

Please sign in to comment.