Skip to content

Commit

Permalink
fix: footer should be fullwidth (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
LancelotLewis authored Apr 9, 2024
1 parent c1165ba commit d2b1012
Show file tree
Hide file tree
Showing 11 changed files with 230 additions and 156 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ jobs:
- name: Initialize
run: make github-init

# - name: Extract current version
# id: get_version
# run: |
# CURRENT_VERSION=$(cat version | awk '{$1=$1;print}')
# echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV

# - name: Config Git
# run: |
# git config --local user.name "bot"
# git config --local user.email "bot@arcblock.io"

# - name: Publish to NPM
# run: |
# npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
# VERSION=$(cat version | awk '{$1=$1;print}')
# echo "publish version ${VERSION}"
# lerna version ${CURRENT_VERSION} --exact --no-push --force-publish --yes
# lerna publish from-git --yes
# curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"did-connect packages v${VERSION} was successfully published\"}" ${{ secrets.SLACK_WEBHOOK }}

# - name: Push Version
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GIT_HUB_TOKEN }}
# branch: ${{ github.ref }}
- name: Extract current version
id: get_version
run: |
CURRENT_VERSION=$(cat version | awk '{$1=$1;print}')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Config Git
run: |
git config --local user.name "bot"
git config --local user.email "bot@arcblock.io"
- name: Publish to NPM
run: |
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
VERSION=$(cat version | awk '{$1=$1;print}')
echo "publish version ${VERSION}"
lerna version ${CURRENT_VERSION} --exact --no-push --force-publish --yes
lerna publish from-git --yes
curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"did-connect packages v${VERSION} was successfully published\"}" ${{ secrets.SLACK_WEBHOOK }}
- name: Push Version
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GIT_HUB_TOKEN }}
branch: ${{ github.ref }}

# - name: Bundle Blocklets
# run: make bundle
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.3 (April 09, 2024)

- fix(playground): footer should be fullwidth

## 2.2.2 (April 09, 2024)

- chore: update ci
Expand Down
20 changes: 10 additions & 10 deletions playground/react/api/routes/auth/request-transaction-signature.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-console */
const { toTypeInfo } = require('@arcblock/did');
const { fromPublicKey } = require('@ocap/wallet');
const { fromBase58, toBase58 } = require('@ocap/util');
const { toTxHash } = require('@ocap/mcrypto');
const { toBase58 } = require('@ocap/util');

const logger = require('../../libs/logger');
const env = require('../../libs/env');
Expand All @@ -15,6 +16,7 @@ module.exports = {
signature: async ({ userPk, userDid }) => {
const value = await client.fromTokenToUnit(1);
const type = toTypeInfo(userDid);

const encoded = await client.encodeTransferV2Tx({
tx: {
itx: {
Expand All @@ -29,6 +31,7 @@ module.exports = {
},
wallet: fromPublicKey(userPk, type),
});

const origin = toBase58(encoded.buffer);

return {
Expand All @@ -42,20 +45,17 @@ module.exports = {
// eslint-disable-next-line consistent-return
onAuth: ({ userDid, userPk, claims, updateSession }) => {
const claim = claims.find((x) => x.type === 'signature');
const tx = client.decodeTx(claim.origin);

logger.info(`${action}.onAuth`, { userPk, userDid, claim });

// if (claim.origin) {
// const type = toTypeInfo(userDid);
// const user = fromPublicKey(userPk, type);
// if (user.verify(claim.origin, claim.sig, claim.method !== 'none') === false) {
// throw new Error('Origin 签名错误');
// }
// }
const buffer = Buffer.from(claim.origin);
const hash = toTxHash(buffer);

updateSession({
result: {
transaction: fromBase58(claim.origin).toString(),
hash,
tx,
origin: claim.origin,
sig: claim.sig,
},
});
Expand Down
8 changes: 6 additions & 2 deletions playground/react/blocklet.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# template-react
# DID Connect Playground

A react template for creating a new blocklet project.
A Playground shows Simple DID Connect workflow

![step-1](./screenshots/1-step_1.png)

![step-2](./screenshots/2-step_2.png)
4 changes: 2 additions & 2 deletions playground/react/blocklet.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: z2qa7dZjxsMMCXMCUG9NFDooAMPjzSE2XYsZ4
title: DID Connect Playground React
title: DID Connect Playground
description: A Blocklet show DID Connect Playground
keywords:
- blocklet
Expand All @@ -17,7 +17,7 @@ repository:
type: git
url: git+https://github.com/arcblock/did-connect.git
specVersion: 1.2.8
version: 2.2.2
version: 2.2.3
logo: logo.png
files:
- dist
Expand Down
Binary file modified playground/react/screenshots/2-step_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions playground/react/src/components/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ import Footer from '@blocklet/ui-react/lib/Footer';
export default function Layout({ children }) {
return (
<Box>
<Header fullWidth maxWidth={null} />
<Header maxWidth="unset" />
<Container maxWidth="lg" my={3}>
{children}
</Container>
<Footer />
<Box
component={Footer}
sx={{
'&>div>.MuiContainer-root': {
maxWidth: 'unset',
},
}}
/>
</Box>
);
}
Expand Down
5 changes: 3 additions & 2 deletions playground/react/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export default flatten({
},
requestTransactionSig: {
title: 'Request Transaction Signature',
description: 'When the app needs user to sign some transaction that can be broadcast to arcblock chain.',
description: 'When the app needs user to sign some transaction that can be broadcast to ArcBlock chain.',
connect: {
title: 'Request Transaction Signature',
scan: 'Please sign a transaction to continue',
},
result: {
transaction: 'Transaction Hash',
hash: 'Transaction Hash',
signature: 'Signature',
},
},
Expand All @@ -81,6 +81,7 @@ export default flatten({
},
result: {
hash: 'Transaction Hash',
signature: 'Signature',
},
},
multipleClaims: {
Expand Down
7 changes: 4 additions & 3 deletions playground/react/src/locales/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default flatten({
},
step2: {
title: '第二步',
enjoyPlayground: '享受 DID Connect 演示平台',
enjoyPlayground: '享受 DID Connect 游乐场',
},
claims: {
requestProfile: {
Expand Down Expand Up @@ -61,13 +61,13 @@ export default flatten({
},
requestTransactionSig: {
title: '请求交易签名',
description: '当应用需要用户签名一个可以广播到 Ark 链的交易时。',
description: '当应用需要用户签名一个可以广播到 ArcBlock 链的交易时。',
connect: {
title: '请求交易签名',
scan: '请签名一个交易,以便验证交易的安全性。',
},
result: {
transaction: '交易 hash',
hash: '交易 hash',
signature: '签名结果',
},
},
Expand All @@ -81,6 +81,7 @@ export default flatten({
},
result: {
hash: '交易 hash',
signature: '签名结果',
},
},
multipleClaims: {
Expand Down
Loading

0 comments on commit d2b1012

Please sign in to comment.