Skip to content

Commit a4fca7f

Browse files
Merge pull request #5 from matthieubosquet/minimal-styles
Added minimal styling to form interface, Added .env to gitignore, int…
2 parents eecca1d + a484964 commit a4fca7f

File tree

7 files changed

+87
-25
lines changed

7 files changed

+87
-25
lines changed

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Example environment variables for this project
2+
# Copy this file to `.env.local` (or `.env`) and fill in real values before running the app.
3+
4+
# The URI of the Solid container used by the demo Community Solid Server
5+
# Default for local dev (Community Solid Server started by `npm run start:css`)
6+
NEXT_PUBLIC_BASE_URI="http://localhost:3001/"
7+
8+
# The manifest resource file used by the app (relative to the container root)
9+
NEXT_PUBLIC_MANIFEST_RESOURCE_URI="resource.ttl"
10+
11+
# Admin WebID used for booting the demo (replace with your WebID)
12+
NEXT_PUBLIC_ADMIN_WEBID="https://id.inrupt.com/your-webid"
13+
14+
# Notes:
15+
# - Never commit secrets. This file is safe to commit because it contains placeholders only.
16+
# - For private credentials (if any), keep them in `.env` or `.env.local` which are ignored by git.

.env.local

Lines changed: 0 additions & 14 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ yarn-error.log*
4141
*.tsbuildinfo
4242
next-env.d.ts
4343
/.vs
44+
.env.local

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ Therefore, you need a [WebID](https://solid.github.io/webid-profile/) to correct
1111

1212
A WebID is a URL you control and can use to sign in to Solid Apps.
1313

14-
Before running the app, set the `NEXT_PUBLIC_ADMIN_WEBID` environment variable in .env.local.
14+
Before running the app, set the `NEXT_PUBLIC_ADMIN_WEBID` environment variable in `.env.local`.
15+
16+
Environment variables
17+
---------------------
18+
19+
This project includes a `.env.example` file with the placeholders for environment variables used by the app (for example `NEXT_PUBLIC_BASE_URI`, `NEXT_PUBLIC_MANIFEST_RESOURCE_URI`, and `NEXT_PUBLIC_ADMIN_WEBID`).
20+
21+
Copy the example to a local env file and edit values before running the app
22+
23+
Note: `.env` and `.env.local` are ignored by git by default (see `.gitignore`), so you can keep private credentials locally without committing them. The `.env.example` file is safe to commit and documents which variables are required.
1524

1625
### Creating a WebID
1726

package-lock.json

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ui/ListEditor.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { List, Item } from "../../ldo/Model.typings";
1212
import { Config } from "../../Config";
1313
import { ListViewer } from "../../components/ui/ListViewer";
1414
import { fetchList } from "../../fetchList";
15+
import style from "../../styles/ListEditorStyle.module.css";
1516

1617
export function ListEditor() {
1718
const [newName, setNewName] = useState("");
@@ -31,12 +32,12 @@ export function ListEditor() {
3132
<>
3233
<ListViewer data={list} deleteHandler={removeItem} />
3334

34-
<form onSubmit={addItem}>
35-
<fieldset>
36-
<legend>new item</legend>
35+
<form onSubmit={addItem} className={style.form_cont}>
36+
<fieldset className={style.fieldset_cont}>
37+
<legend>New Item</legend>
3738
<div>
3839
<label>
39-
<span>name</span>
40+
<span>Name</span>
4041
<input
4142
required
4243
value={newName}
@@ -46,7 +47,7 @@ export function ListEditor() {
4647
</div>
4748
<div>
4849
<label>
49-
<span>description</span>
50+
<span>Description</span>
5051
<input
5152
required
5253
value={newDescription}
@@ -57,8 +58,8 @@ export function ListEditor() {
5758
</label>
5859
</div>
5960
<div>
60-
<label>
61-
<span>featured</span>
61+
<label className={style.checkbox_label}>
62+
<span>Featured</span>
6263
<input
6364
type="checkbox"
6465
checked={newFeatured}
@@ -70,7 +71,7 @@ export function ListEditor() {
7071
</div>
7172
<div>
7273
<label>
73-
<span>website</span>
74+
<span>Website</span>
7475
<input
7576
required
7677
type="url"
@@ -83,7 +84,7 @@ export function ListEditor() {
8384
</div>
8485
<div>
8586
<label>
86-
<span>thumbnail</span>
87+
<span>Thumbnail</span>
8788
<input
8889
required
8990
type="file"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.form_cont {
2+
background-color: white;
3+
padding: 1rem;
4+
border-radius: 8px;
5+
}
6+
7+
.fieldset_cont {
8+
max-width: 600px;
9+
margin: 0 auto;
10+
width: 100%;
11+
display: flex;
12+
flex-direction: column;
13+
gap: 1rem;
14+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
15+
border: none;
16+
border-radius: 8px;
17+
padding: 20px 16px;
18+
}
19+
20+
.checkbox_label {
21+
display: flex;
22+
flex-direction: row !important;
23+
align-items: center;
24+
gap: 8px;
25+
}
26+
27+
.fieldset_cont label {
28+
display: flex;
29+
flex-direction: column;
30+
gap: 4px;
31+
}
32+
33+
.fieldset_cont label span {
34+
font-weight: 600;
35+
color: #333;
36+
}
37+
38+
.fieldset_cont input[type="text"],
39+
.fieldset_cont input[type="url"],
40+
.fieldset_cont input[type="file"] {
41+
padding: 8px;
42+
border: 1px solid #ccc;
43+
border-radius: 4px;
44+
font-size: 1rem;
45+
}

0 commit comments

Comments
 (0)