Skip to content

Commit

Permalink
Merge pull request #379 from P4-Games/feature/version
Browse files Browse the repository at this point in the history
merge feature/version into develop
  • Loading branch information
dappsar committed Jul 20, 2024
2 parents cc1122a + 452d16c commit a204984
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ hardhat.config.ts
# misc
.DS_Store
*.pem
.todo.md

# debug
npm-debug.log*
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ARG MAIL_SG_FROM
ARG NEXT_PUBLIC_STORAGE_URL_ALPHA
ARG NEXT_PUBLIC_STORAGE_URL_GAMMA
ARG NEXT_PUBLIC_ADMIN_ACCOUNTS
ARG NEXT_PUBLIC_NOF_VERSION


# env
Expand All @@ -52,6 +53,7 @@ ENV MAIL_SG_FROM $MAIL_SG_FROM
ENV NEXT_PUBLIC_STORAGE_URL_ALPHA $NEXT_PUBLIC_STORAGE_URL_ALPHA
ENV NEXT_PUBLIC_STORAGE_URL_GAMMA $NEXT_PUBLIC_STORAGE_URL_GAMMA
ENV NEXT_PUBLIC_ADMIN_ACCOUNTS $NEXT_PUBLIC_ADMIN_ACCOUNTS
ENV NEXT_PUBLIC_NOF_VERSION $NEXT_PUBLIC_NOF_VERSION


COPY --from=deps /app/node_modules ./node_modules
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ NEXT_PUBLIC_APP_ENV='development'
NEXT_PUBLIC_STORAGE_URL_ALPHA='https://storage.googleapis.com/nof-alpha'
NEXT_PUBLIC_STORAGE_URL_GAMMA='https://storage.googleapis.com/nof-gamma'
NEXT_PUBLIC_ADMIN_ACCOUNTS='0x35dad65F60c1A32c9895BE97f6bcE57D32792E83,0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
NEXT_PUBLIC_NOF_VERSION='v0.0.0'

# Only por local environment to put contracts addresses from hardhat
NEXT_PUBLIC_NOF_DAI_HARDHAT_CONTRACT_ADDRESS=''
Expand Down
4 changes: 2 additions & 2 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ steps:
- NEXT_PUBLIC_STORAGE_URL_ALPHA=${_NEXT_PUBLIC_STORAGE_URL_ALPHA}
- NEXT_PUBLIC_STORAGE_URL_GAMMA=${_NEXT_PUBLIC_STORAGE_URL_GAMMA}
- NEXT_PUBLIC_ADMIN_ACCOUNTS=${_NEXT_PUBLIC_ADMIN_ACCOUNTS}

- NEXT_PUBLIC_NOF_VERSION=${_NEXT_PUBLIC_NOF_VERSION}

# build the container images
- name: "gcr.io/cloud-builders/docker"
Expand Down Expand Up @@ -61,7 +61,7 @@ steps:
"--build-arg", "NEXT_PUBLIC_STORAGE_URL_ALPHA=${_NEXT_PUBLIC_STORAGE_URL_ALPHA}",
"--build-arg", "NEXT_PUBLIC_STORAGE_URL_GAMMA=${_NEXT_PUBLIC_STORAGE_URL_GAMMA}",
"--build-arg", "NEXT_PUBLIC_ADMIN_ACCOUNTS=${_NEXT_PUBLIC_ADMIN_ACCOUNTS}",

"--build-arg", "NEXT_PUBLIC_NOF_VERSION=${_NEXT_PUBLIC_NOF_VERSION}",
"."
]

Expand Down
1 change: 1 addition & 0 deletions example_env
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ NEXT_PUBLIC_APP_ENV='development'
NEXT_PUBLIC_STORAGE_URL_ALPHA='https://storage.googleapis.com/nof-alpha'
NEXT_PUBLIC_STORAGE_URL_GAMMA='https://storage.googleapis.com/nof-gamma'
NEXT_PUBLIC_ADMIN_ACCOUNTS='0x...,0X....,0xfa3....' // accounts separated by a comma
NEXT_PUBLIC_NOF_VERSION='v0.1.219'

// Only por local environment to put contracts addresses from hardhat
NEXT_PUBLIC_NOF_DAI_CONTRACT_CURRENT_ADDRESS=''
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"git-config": "git config --global core.autocrlf true",
"git-log": "git log --oneline --decorate",
"gitp": "git log --pretty=”%s”",
"commitlint-check-comit-msg": "npx --no-install commitlint --edit \"$1\""
"commitlint-check-comit-msg": "npx --no-install commitlint --edit \"$1\"",
"docker:build": "bash ./scripts/docker-build.sh",
"docker:run": "bash docker run -d -p 3000:3000 --name my-nextjs-container my-nextjs-app"
},
"dependencies": {
"@next/eslint-plugin-next": "^14.0.1",
Expand Down
36 changes: 36 additions & 0 deletions scripts/docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Mover al directorio raíz del proyecto
cd "$(dirname "$0")/.."

# Exportar variables de entorno desde el archivo .env
export $(grep -v '^#' .env | xargs)

# Volver al directorio scripts
cd scripts

# Ejecutar docker build con las variables de entorno como argumentos de compilación
docker build \
--build-arg APP_ENV="$APP_ENV" \
--build-arg NODE_ENV="$NODE_ENV" \
--build-arg MONGODB="$MONGODB" \
--build-arg GAMMA_SERVICE_URL="$GAMMA_SERVICE_URL" \
--build-arg GRAPH_URL="$GRAPH_URL" \
--build-arg WALLET_CONNECT_PROJECT_ID="$WALLET_CONNECT_PROJECT_ID" \
--build-arg NODE_PROVIDER_MUMBAI_URL="$NODE_PROVIDER_MUMBAI_URL" \
--build-arg NODE_PROVIDER_BSC_TESTNET_URL="$NODE_PROVIDER_BSC_TESTNET_URL" \
--build-arg NODE_PROVIDER_OPBNB_TESTNET="$NODE_PROVIDER_OPBNB_TESTNET" \
--build-arg MAIL_CLIENT="$MAIL_CLIENT" \
--build-arg MAIL_FROM="$MAIL_FROM" \
--build-arg MAIL_TO="$MAIL_TO" \
--build-arg MAIL_ETHEREAL_HOST="$MAIL_ETHEREAL_HOST" \
--build-arg MAIL_ETHEREAL_PORT="$MAIL_ETHEREAL_PORT" \
--build-arg MAIL_ETHEREAL_USER="$MAIL_ETHEREAL_USER" \
--build-arg MAIL_ETHEREAL_PSWD="$MAIL_ETHEREAL_PSWD" \
--build-arg MAIL_SG_KEY="$MAIL_SG_KEY" \
--build-arg MAIL_SG_FROM="$MAIL_SG_FROM" \
--build-arg NEXT_PUBLIC_STORAGE_URL_ALPHA="$NEXT_PUBLIC_STORAGE_URL_ALPHA" \
--build-arg NEXT_PUBLIC_STORAGE_URL_GAMMA="$NEXT_PUBLIC_STORAGE_URL_GAMMA" \
--build-arg NEXT_PUBLIC_ADMIN_ACCOUNTS="$NEXT_PUBLIC_ADMIN_ACCOUNTS" \
--build-arg NEXT_PUBLIC_NOF_VERSION="$NEXT_PUBLIC_NOF_VERSION" \
-t my-nextjs-app ..
2 changes: 2 additions & 0 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AccountInfo from './AccountInfo.jsx'
import NotificationInfo from './NotificationInfo.jsx'
import LanguageSelection from '../LanguageSelection'
import { useLayoutContext, useWeb3Context, useNotificationContext } from '../../hooks'
import { nofVersion } from '../../config.js'

function Navbar() {
const { t } = useTranslation()
Expand Down Expand Up @@ -88,6 +89,7 @@ function Navbar() {
<Link href='/'>
<Image src={'/images/navbar/logo-1.png'} alt='nof' height='60' width='120' />
</Link>
<span className='navbar__left__nof__version'>{nofVersion}</span>
</div>
)

Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const storageUrlGamma =
process.env.NEXT_PUBLIC_STORAGE_URL_GAMMA || 'https://storage.googleapis.com/nof-gamma'
export const adminAccounts =
process.env.NEXT_PUBLIC_ADMIN_ACCOUNTS || '0x8a8F5e5ae88532c605921f320a92562c9599fB9E'
export const nofVersion = process.env.NEXT_PUBLIC_NOF_VERSION || 'v0.1.219'

// ------------------------------------------------------------------
// calculated variables
Expand Down
17 changes: 17 additions & 0 deletions src/styles/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,20 @@ header {
margin-right: 10px;
}
}

.navbar__left__nof {
position: relative;
}

.navbar__left__nof__version {
position: absolute;
bottom: -22px; /* Ajusta según sea necesario */
left: 50%;
transform: translateX(-50%);
font-size: 8px; /* Ajusta el tamaño de la fuente según prefieras */
color: #343131; /* Cambia el color si es necesario */
background: #ede8e8; /* Puedes cambiar el fondo si quieres */
padding: 2px 5px;
border-radius: 4px;
text-align: center;
}

0 comments on commit a204984

Please sign in to comment.