Skip to content

Commit 930882d

Browse files
committed
feat: add custom theme guide
1 parent fbf9e0d commit 930882d

File tree

5 files changed

+67
-19
lines changed

5 files changed

+67
-19
lines changed

README.md

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,37 @@ A demo of the application is available at [https://essentials-stg.vercel.app/](h
1212
* Responsive design for use on desktop and mobile devices.
1313
* Comprehensive testing suite using Jest and React Testing Library.
1414

15+
## Custom Theme Guide
16+
17+
### Network Logo
18+
19+
Network logos should be placed in the `/public/images/network/` directory with the following specifications:
20+
21+
* File Format: PNG format (transparent background recommended)
22+
* File Naming: Should match the network identifier (e.g., `assethub-westend.png`, `paseo.png`)
23+
* Design Style: Both circular or square logos are acceptable, but visual clarity should be ensured
24+
25+
Currently available network logos:
26+
27+
* `assethub-westend.png`
28+
* `paseo.png`
29+
30+
### Network Banner Images
31+
32+
Network banner images should be placed in:
33+
34+
* Path: `/public/images/banner/`
35+
* File Format: PNG or JPG
36+
* Banner images will be displayed at the top of network pages
37+
* Design Style: Should reflect the network's characteristics and may include the network name, logo, and related visual elements
38+
39+
### Adding New Network Images
40+
41+
1. Prepare image files according to the specifications above
42+
2. Add the network logo to `/public/images/network/[network-id].png`
43+
3. Update the network banner to `/public/images/banner/navbar.png`
44+
4. The application will automatically detect and display the corresponding images based on the network identifier
45+
1546
## Getting Started
1647

1748
### Prerequisites
@@ -21,20 +52,25 @@ A demo of the application is available at [https://essentials-stg.vercel.app/](h
2152

2253
### Installation
2354

24-
1. Clone the repository:
25-
```bash
26-
git clone https://github.com/itering/subscan-essentials-ui-react.git
27-
```
28-
2. Navigate to the project directory:
29-
```bash
30-
cd subscan-essentials-ui-react
31-
```
32-
3. Install dependencies:
33-
```bash
34-
npm install
35-
# or
36-
yarn install
37-
```
55+
1. Clone the repository:
56+
57+
```bash
58+
git clone https://github.com/itering/subscan-essentials-ui-react.git
59+
```
60+
61+
1. Navigate to the project directory:
62+
63+
```bash
64+
cd subscan-essentials-ui-react
65+
```
66+
67+
1. Install dependencies:
68+
69+
```bash
70+
npm install
71+
# or
72+
yarn install
73+
```
3874

3975
### Running the Development Server
4076

12.3 KB
Loading

public/images/network/paseo.png

2.94 KB
Loading

src/components/navbar/navbar.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import {
1414
DropdownTrigger,
1515
Link,
1616
Input,
17-
Image,
1817
Select,
1918
SelectItem,
2019
Divider,
2120
} from '@heroui/react'
2221
import { useData } from '@/context'
22+
import Image from 'next/image'
2323
import _ from 'lodash'
2424

2525
interface Props extends BareProps {
@@ -173,7 +173,7 @@ const Component: React.FC<Props> = ({ children, className }) => {
173173
<div
174174
className="bg-no-repeat bg-cover bg-center"
175175
style={{
176-
backgroundImage: 'url(/images/navbar.png)',
176+
backgroundImage: 'url(/images/banner/navbar.png)',
177177
backgroundSize: 'cover',
178178
}}>
179179
<Navbar
@@ -363,6 +363,18 @@ const Component: React.FC<Props> = ({ children, className }) => {
363363
</NavbarItem>
364364
</>
365365
)}
366+
<NavbarItem>
367+
<div className='bg-white rounded-lg px-2.5 py-0.5'>
368+
<Image
369+
width={0}
370+
height={0}
371+
sizes="100vw"
372+
className="hidden md:block h-[30px] w-auto"
373+
src={`/images/network/${metadata?.networkNode}.png`}
374+
alt={metadata?.networkNode || 'Network Name'}
375+
/>
376+
</div>
377+
</NavbarItem>
366378
</NavbarContent>
367379
</Navbar>
368380
<div className="w-full px-4 pb-6 flex justify-center">
@@ -380,7 +392,7 @@ const Component: React.FC<Props> = ({ children, className }) => {
380392
placeholder="Search"
381393
size="md"
382394
startContent={
383-
<div className='flex h-5 items-center'>
395+
<div className="flex h-5 items-center">
384396
<Select
385397
className=""
386398
classNames={{
@@ -401,10 +413,10 @@ const Component: React.FC<Props> = ({ children, className }) => {
401413
<SelectItem key={item.value}>{item.name}</SelectItem>
402414
))}
403415
</Select>
404-
<Divider orientation="vertical" className='mx-4'/>
416+
<Divider orientation="vertical" className="mx-4" />
405417
</div>
406418
}
407-
endContent={<SearchIcon fill="none" size={24} onClick={handleRedirect} className="mr-3 cursor-pointer"/>}
419+
endContent={<SearchIcon fill="none" size={24} onClick={handleRedirect} className="mr-3 cursor-pointer" />}
408420
/>
409421
</div>
410422
</div>

0 commit comments

Comments
 (0)