Fix empty images section if no images + Remove postgres port

This commit is contained in:
Ahmed Al-Taiar
2024-10-17 20:46:34 -04:00
parent 7973663b2a
commit cbf75acbeb
3 changed files with 21 additions and 22 deletions

View File

@ -21,7 +21,7 @@ services:
- API_PROXY_TARGET=http://localhost:8911 - API_PROXY_TARGET=http://localhost:8911
- MAX_HTTP_CONNECTIONS_PER_MINUTE=60 - MAX_HTTP_CONNECTIONS_PER_MINUTE=60
- SESSION_SECRET=super_secret_session_key_change_me_in_production_please - SESSION_SECRET=super_secret_session_key_change_me_in_production_please
- DATABASE_URL=postgresql://redwood:changeme@db:5432/portfolio - DATABASE_URL=postgresql://redwood:changeme@db/portfolio
- FIRST_NAME=first name # Your first name - FIRST_NAME=first name # Your first name
- LAST_NAME=lastname # Your last name - LAST_NAME=lastname # Your last name
- SMTP_HOST=smtp.example.com - SMTP_HOST=smtp.example.com
@ -58,8 +58,6 @@ services:
- POSTGRES_USER=redwood - POSTGRES_USER=redwood
- POSTGRES_PASSWORD=changeme - POSTGRES_PASSWORD=changeme
- POSTGRES_DB=portfolio - POSTGRES_DB=portfolio
ports:
- 5432:5432
volumes: volumes:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data
@ -75,9 +73,9 @@ sudo docker exec -u root portfolio chown -R node:node /home/node/app/api/files_p
## Logging In ## Logging In
- Once the container is up and running, head to `/login` (`https://portfolio.example.com/login`), default credentials are below - Once the container is up and running, head to `/login` (`https://portfolio.example.com/login`), default credentials are below
- If you would like to change the password, head to `/forgot-password` (`https://portfolio.example.com/forgot-password`), the username is `admin` - If you would like to change the password, head to `/forgot-password` (`https://portfolio.example.com/forgot-password`), the username is `admin`
- If you correctly set up the Gmail app password, you should receive an email from yourself - If you correctly configured [SMTP](#smtp), you should receive an Email from [`EMAIL_FROM`](#docker-compose) to [`EMAIL_TO`](#docker-compose)
- It contains the link needed to change your password - The Email contains the link needed to change your password
### Default Credentials ### Default Credentials
**Username:** `admin` **Username:** `admin`
**Password:** [`SMTP_PASSWORD`](#smtp) **Password:** [`SMTP_PASSWORD`](#docker-compose)

View File

@ -9,7 +9,7 @@ services:
- API_PROXY_TARGET=http://localhost:8911 - API_PROXY_TARGET=http://localhost:8911
- MAX_HTTP_CONNECTIONS_PER_MINUTE=60 - MAX_HTTP_CONNECTIONS_PER_MINUTE=60
- SESSION_SECRET=super_secret_session_key_change_me_in_production_please - SESSION_SECRET=super_secret_session_key_change_me_in_production_please
- DATABASE_URL=postgresql://redwood:changeme@db:5432/portfolio - DATABASE_URL=postgresql://redwood:changeme@db/portfolio
- FIRST_NAME=first name # Your first name - FIRST_NAME=first name # Your first name
- LAST_NAME=lastname # Your last name - LAST_NAME=lastname # Your last name
- SMTP_HOST=smtp.example.com - SMTP_HOST=smtp.example.com
@ -46,8 +46,6 @@ services:
- POSTGRES_USER=redwood - POSTGRES_USER=redwood
- POSTGRES_PASSWORD=changeme - POSTGRES_PASSWORD=changeme
- POSTGRES_DB=portfolio - POSTGRES_DB=portfolio
ports:
- 5432:5432
volumes: volumes:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data

View File

@ -69,20 +69,23 @@ const Project = ({ project }: Props) => {
</div> </div>
</> </>
)} )}
<h2 className="sm:hidden font-bold text-3xl text-center">Images</h2> {project.images.length > 0 && (
<h2 className="sm:hidden font-bold text-3xl text-center">Images</h2>
)}
</div> </div>
<div className="flex flex-wrap gap-4 items-center pt-8 justify-center"> <div className="flex flex-wrap gap-4 pt-8 justify-center h-fit">
{project.images.map((image, i) => ( {project.images.length > 0 &&
<a project.images.map((image, i) => (
href={image} <a
target="_blank" href={image}
rel="noreferrer" target="_blank"
key={i} rel="noreferrer"
className="rounded-xl" key={i}
> className="rounded-xl"
<img src={image} alt="" className="rounded-xl" /> >
</a> <img src={image} alt="" className="rounded-xl" />
))} </a>
))}
</div> </div>
</div> </div>
) )