Skip to content

Commit 8f4354f

Browse files
authored
Merge pull request #56 from sei-protocol/devrel
Merges current and ongoing work from devrel team
2 parents bef5efb + 12ae53f commit 8f4354f

File tree

138 files changed

+24830
-1791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+24830
-1791
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# Contributing to the Docs
2+
13
## Quick Start
4+
25
Ensure you have `yarn` installed (macOS users can Run `brew install yarn`)
36

47
1. Use `yarn` to install dependencies
@@ -12,25 +15,28 @@ You should always run `yarn build` before pushing any changes to validate that t
1215
This documentation is created using [Nextra](https://nextra.site).
1316

1417
### Structure
18+
1519
Each page is generated from a single `.mdx` file under the `./pages` directory.
1620

1721
Each directory represents a page grouping. Each directory contains a `_meta.json` file, which dictates the order and name of the items in the navbar.
1822

1923
For more information on how the docs are structured, please refer to the [Nextra docs](https://nextra.site/docs/guide).
2024

2125
### Changing Content
22-
All content submitted will be reviewed by a maintainer
2326

24-
To standardize the documentation, please follow the [style guide]() for instructions on how to format changes to the docs.
27+
All content submitted will be reviewed by a maintainer
2528

29+
To standardize the documentation, please follow the [style guide](https://github.com/sei-protocol/sei-docs/blob/devrel/STYLE_GUIDE.mdx) for instructions on how to format changes to the docs.
2630

2731
## Open Source Contributors
2832

2933
As an open source and decentralized protocol, we **greatly appreciate** any contributions!
3034
If you feel like the docs can be better in some way, please feel free to fork this repo and make a pull request or open an issue in this Repository.
3135

3236
### Make changes yourself
33-
While the contents of this repository are not technical in nature, contributing requires a basic understanding of
37+
38+
While the contents of this repository are not technical in nature, contributing requires a basic understanding of:
39+
3440
- [Git](https://git-scm.com/downloads)
3541
- Github
3642

@@ -42,7 +48,10 @@ To propose changes directly, you can open a Pull Request against this repository
4248
4. Commit and push your changes to your forked repository.
4349
5. Once your changes have been pushed to your forked repository, [make a Pull Request](https://git-scm.com/downloads) against this repository. Ensure that your Pull Request follows the template so we can understand and review your changes clearly.
4450

45-
### Open an Issue.
51+
### Open an Issue
52+
4653
Alternatively, if you have more general suggestions on how we can improve or correct these docs, you can [open an issue](https://github.com/sei-protocol/sei-docs/issues).
4754

55+
### Addding to the Ecosystem Apps list
4856

57+
We welcome contributions to our ecosystem apps section. Please follow the process detailed in [eco-apps](https://github.com/sei-protocol/sei-docs/tree/main/pages/eco-apps.mdx) to add your own apps.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// components/BrandKitGallery/BrandImage.tsx
2+
import NextImage from 'next/image';
3+
import styles from '../../styles/custom.module.css';
4+
import { useState, useEffect } from 'react';
5+
6+
interface BrandImageProps {
7+
url: string;
8+
alt: string;
9+
name: string;
10+
}
11+
12+
const BrandImage = ({ url, alt, name }: BrandImageProps) => {
13+
const [imageDimensions, setImageDimensions] = useState({ width: 0, height: 0 });
14+
const [showModal, setShowModal] = useState(false);
15+
16+
useEffect(() => {
17+
const img = new window.Image();
18+
img.src = url;
19+
img.onload = () => {
20+
setImageDimensions({ width: img.width, height: img.height });
21+
};
22+
}, [url]);
23+
24+
const handleImageClick = () => {
25+
setShowModal(true);
26+
document.body.style.overflow = 'hidden';
27+
};
28+
29+
const closeModal = () => {
30+
setShowModal(false);
31+
document.body.style.overflow = 'auto';
32+
};
33+
34+
return (
35+
<>
36+
<div className={styles.imageWrapper}>
37+
<div className={styles.imageContainer}>
38+
<NextImage
39+
src={url}
40+
alt={alt}
41+
width={imageDimensions.width}
42+
height={imageDimensions.height}
43+
className={styles.image}
44+
onClick={handleImageClick}
45+
/>
46+
</div>
47+
</div>
48+
{showModal && (
49+
<div className={styles.modal} onClick={closeModal}>
50+
<div className={styles.modalContent}>
51+
<NextImage src={url} alt={alt} layout="fill" objectFit="contain" />
52+
</div>
53+
</div>
54+
)}
55+
</>
56+
);
57+
};
58+
59+
export default BrandImage;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// components/BrandKitGallery/DownloadButton.tsx
2+
import React from 'react';
3+
import styles from '../../styles/custom.module.css';
4+
5+
const DownloadButton = ({ url, fileName, children }) => {
6+
const handleDownload = () => {
7+
const link = document.createElement('a');
8+
link.href = url;
9+
link.setAttribute('download', fileName);
10+
document.body.appendChild(link);
11+
link.click();
12+
document.body.removeChild(link);
13+
};
14+
15+
return (
16+
<button className={styles.downloadButton} onClick={handleDownload}>
17+
{children}
18+
</button>
19+
);
20+
};
21+
22+
export default DownloadButton;

components/BrandKitGallery/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as BrandImage } from './BrandImage';
2+
export { default as DownloadButton } from './DownloadButton';

components/EcosystemApps/EcosystemApps.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
import React, { useState, useMemo, useEffect } from 'react';
22
import { EcosystemCard, EcosystemCards } from '../EcosystemCard';
3-
import appData from '../../data/appData'; // Ensure this import is correct
3+
import appData, { Tag, tagPrettyNames } from '../../data/appData';
44

55
const EcosystemApps = () => {
66
const [searchTerm, setSearchTerm] = useState('');
7-
const [allTags, setAllTags] = useState([]);
7+
const [allTags, setAllTags] = useState<string[]>([]);
88

99
// Extract unique tags from appData
1010
useEffect(() => {
11-
const tags = new Set();
11+
const tags = new Set<string>();
1212
appData.forEach(app => app.tags.forEach(tag => tags.add(tag)));
1313
setAllTags(Array.from(tags));
1414
}, []);
15-
// Filter by "title" and "tag" fields from appData.ts // Filter by "title" and "tag" fields from appData.ts
15+
16+
// Filter by "title" and "tag" fields from appData.ts
1617
const filteredApps = useMemo(() => (
1718
appData.filter(app =>
1819
app.title.toLowerCase().includes(searchTerm.toLowerCase()) ||
19-
app.tags.some(tag => tag.toLowerCase().includes(searchTerm.toLowerCase()))
20+
app.tags.some(tag =>
21+
tagPrettyNames[tag]?.some(prettyName => prettyName.toLowerCase().includes(searchTerm.toLowerCase()))
22+
)
2023
)
2124
), [searchTerm]);
2225

2326
return (
2427
<div>
2528
<input
2629
type="text"
27-
placeholder="Search apps by name or tag..."
30+
placeholder="Search apps by name or category..."
2831
value={searchTerm}
2932
onChange={(e) => setSearchTerm(e.target.value)}
3033
className="w-full p-2 text-sm border rounded shadow-sm placeholder-gray-400"
3134
/>
3235
<div className="mt-2 mb-4 text-sm text-gray-600">
33-
<strong>Filter by Tags:</strong> {allTags.join(', ')}
36+
{allTags.join(', ')}
3437
</div>
3538
<EcosystemCards>
3639
{filteredApps.length > 0 ? (

components/EcosystemCard/EcosystemCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function EcosystemCard({ image, title, description, href }: EcosystemCardProps)
1919
target="_blank"
2020
rel="noopener noreferrer"
2121
>
22-
<div className="relative w-full"> {/* Adjust height as needed to match your design */}
22+
<div className="relative w-full">
2323
<Image src={image} alt={title} width={700} height={475} priority />
2424
</div>
2525
<div className="flex-1 p-4 bg-gray-100 dark:bg-gray-800">
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// components/EvmWalletConnect/CustomConnectButton.tsx
2+
import { ConnectButton } from "@rainbow-me/rainbowkit";
3+
import styled from 'styled-components';
4+
5+
const CustomButton = styled.button`
6+
background: #001B2A; /* Dark color */
7+
border: none;
8+
color: #ECDEDE; /* Light color */
9+
padding: 0.5rem 1rem;
10+
font-size: 1rem;
11+
cursor: pointer;
12+
transition: color 0.3s, background 0.3s;
13+
display: inline-block;
14+
margin-top: 1rem;
15+
margin-right: 0.5rem;
16+
border-radius: 25px; /* Rounded corners */
17+
text-align: center;
18+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
19+
font-family: 'Inter', sans-serif;
20+
21+
&:hover {
22+
color: #001B2A; /* Dark color */
23+
background: #ECDEDE; /* Light color */
24+
}
25+
`;
26+
27+
const CustomConnectButton = (props) => (
28+
<ConnectButton.Custom>
29+
{({ account, chain, openAccountModal, openConnectModal, openChainModal, mounted }) => {
30+
const ready = mounted;
31+
const connected = ready && account && chain;
32+
33+
return (
34+
<div
35+
{...(!ready && {
36+
'aria-hidden': true,
37+
'style': {
38+
opacity: 0,
39+
pointerEvents: 'none',
40+
userSelect: 'none'
41+
},
42+
})}
43+
>
44+
{(() => {
45+
if (!connected) {
46+
return (
47+
<CustomButton onClick={openConnectModal} type="button">
48+
Connect Wallet
49+
</CustomButton>
50+
);
51+
}
52+
53+
if (chain.unsupported) {
54+
return (
55+
<CustomButton onClick={openChainModal} type="button">
56+
Wrong network
57+
</CustomButton>
58+
);
59+
}
60+
61+
return (
62+
<CustomButton onClick={openAccountModal} type="button">
63+
{account.displayName}
64+
</CustomButton>
65+
);
66+
})()}
67+
</div>
68+
);
69+
}}
70+
</ConnectButton.Custom>
71+
);
72+
73+
export default CustomConnectButton;
Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,68 @@
1+
// components/EvmWalletConnect/EvmWalletConnect.tsx
12
import {
2-
ConnectButton,
3-
connectorsForWallets,
4-
RainbowKitProvider,
3+
connectorsForWallets,
4+
RainbowKitProvider,
55
} from "@rainbow-me/rainbowkit";
66
import { injectedWallet, metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
77
import { Chain, configureChains, createConfig, WagmiConfig } from "wagmi";
88
import { publicProvider } from "wagmi/providers/public";
99
import "@rainbow-me/rainbowkit/styles.css";
1010
import { ChainRpcUrls } from "viem/_types/types/chain";
11+
import CustomConnectButton from './CustomConnectButton';
1112

1213
export default function EvmWalletConnect() {
13-
const rpcUrl: ChainRpcUrls = {
14-
http: ["https://evm-rpc-arctic-1.sei-apis.com"],
15-
webSocket: ["wss://evm-ws-arctic-1.sei-apis.com"],
16-
};
17-
const seiDevnet: Chain = {
18-
id: 713715,
19-
name: "Sei EVM Devnet",
20-
network: "sei",
21-
nativeCurrency: {
22-
decimals: 18,
23-
name: "Sei",
24-
symbol: "SEI",
25-
},
26-
rpcUrls: {
27-
public: rpcUrl,
28-
default: rpcUrl,
29-
},
30-
testnet: true,
31-
blockExplorers: {
32-
default: { name: "Seistream", url: "https://seistream.app/" },
33-
},
34-
};
14+
const rpcUrl: ChainRpcUrls = {
15+
http: ["https://evm-rpc.sei-apis.com"],
16+
webSocket: ["wss://evm-ws.sei-apis.com"],
17+
};
18+
const sei: Chain = {
19+
id: 531,
20+
name: "Sei Network",
21+
network: "Sei",
22+
nativeCurrency: {
23+
decimals: 18,
24+
name: "Sei",
25+
symbol: "SEI",
26+
},
27+
rpcUrls: {
28+
public: rpcUrl,
29+
default: rpcUrl,
30+
},
31+
testnet: true,
32+
blockExplorers: {
33+
default: { name: "Seitrace", url: "https://seitrace.com" },
34+
},
35+
};
3536

36-
const { chains, publicClient } = configureChains(
37-
[seiDevnet],
38-
[publicProvider()]
39-
);
37+
const { chains, publicClient } = configureChains(
38+
[sei],
39+
[publicProvider()]
40+
);
4041

41-
const projectId = "385413c214cb74213e0679bc30dd4e4c";
42-
const connectors = connectorsForWallets([
42+
const projectId = "385413c214cb74213e0679bc30dd4e4c";
43+
const connectors = connectorsForWallets([
4344
{
44-
groupName: "Recommended",
45-
wallets: [
45+
groupName: "Recommended",
46+
wallets: [
4647
injectedWallet({ chains }),
4748
metaMaskWallet({ projectId, chains }),
48-
],
49+
],
4950
},
50-
]);
51+
]);
5152

52-
const wagmiConfig = createConfig({
53+
const wagmiConfig = createConfig({
5354
autoConnect: false,
5455
connectors,
5556
publicClient,
56-
});
57+
});
5758

58-
return (
59+
return (
5960
<div className="my-4 flex justify-center">
60-
<WagmiConfig config={wagmiConfig}>
61+
<WagmiConfig config={wagmiConfig}>
6162
<RainbowKitProvider chains={chains}>
62-
<ConnectButton
63-
accountStatus="address"
64-
chainStatus="icon"
65-
showBalance={false}
66-
/>
63+
<CustomConnectButton />
6764
</RainbowKitProvider>
68-
</WagmiConfig>
65+
</WagmiConfig>
6966
</div>
70-
);
67+
);
7168
}

0 commit comments

Comments
 (0)