Skip to content

Commit

Permalink
feat: staging message
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-ko committed Oct 31, 2023
1 parent a0f3d34 commit 1f8a3d2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
registry-url: 'https://npm.pkg.github.com'
node-version: 18.0.0
cache: 'yarn'
- name: Declare some variables
shell: bash
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
echo "now=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- name: Prepare SSH
run: |
mkdir ~/.ssh
Expand All @@ -31,6 +37,9 @@ jobs:
echo "REACT_APP_RESOLVER_BACKEND=http://${{ secrets.STAGING_HOST }}/resolver-handler" >> ./.env.react
echo "REACT_APP_USER_ENS_SUBDOMAIN=.beta-user.dm3.eth" >> ./.env.react
echo "REACT_APP_WALLET_CONNECT_PROJECT_ID=${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}" >> ./.env.react
echo "REACT_APP_COMMIT_HASH=${{ env.sha_short }}" >> ./.env.react
echo "REACT_APP_BRANCH=${{ env.branch }}" >> ./.env.react
echo "REACT_APP_BUILD_TIME=${{ env.now }}" >> ./.env.react
cat ./.env.react >> ./.env
echo "RESOLVER_ADDR=0xae6646c22D8eE6479eE0a39Bf63B9bD9e57bAD9d" >> ./.env
echo "SIGNING_PUBLIC_KEY=${{ secrets.SIGNING_PUBLIC_KEY }}" >> ./.env
Expand Down
31 changes: 25 additions & 6 deletions packages/messenger-widget/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,30 @@ export function DM3(props: Partial<Config>) {
setTheme(propsData.theme);

return (
<div className="container-fluid">
<ErrorModal />
<GlobalContextProvider>
<Home config={propsData} />
</GlobalContextProvider>
</div>
<>
<div className="container-fluid">
<ErrorModal />
<GlobalContextProvider>
<Home config={propsData} />
</GlobalContextProvider>
</div>
{process.env.REACT_APP_COMMIT_HASH && (
<div
style={{
position: 'fixed',
bottom: '0',
backdropFilter: 'blur(5px)',
background: 'rgba(255,174,52,.1)',
color: 'rgba(255,174,52,.9)',
zIndex: '9999999',
fontFamily: 'monospace'
}}
className="w-100 text-center"
>
STAGING {process.env.REACT_APP_BUILD_TIME}{' '}
{process.env.BRANCH} {process.env.REACT_APP_COMMIT_HASH}
</div>
)}
</>
);
}

0 comments on commit 1f8a3d2

Please sign in to comment.