Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teia UI update #449

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
36a1ad3
first draft of waveform image generator
ryangtanaka-org Dec 20, 2024
ddfd454
metadata tweaks and fixes
ryangtanaka-org Dec 20, 2024
7443f99
metadata styling (and added teia's contract)
ryangtanaka-org Dec 20, 2024
d30eee5
fixed ogg error and rerendering lag
ryangtanaka-org Jan 4, 2025
4f91d69
mint form persist input fix and UI updates
ryangtanaka-org Jan 6, 2025
9c0fb5d
preview canvas image fix
ryangtanaka-org Jan 8, 2025
afc908f
faq page update
ryangtanaka-org Feb 1, 2025
7b6bd24
copyright clauses faq
ryangtanaka-org Feb 1, 2025
4df6007
policy and terms update
ryangtanaka-org Feb 1, 2025
4f4cdb7
polls and dao metadata update
ryangtanaka-org Feb 2, 2025
c292f12
Subtitles to the swap page for clarity
ryangtanaka-org Feb 2, 2025
a5381cc
DAO treasury and TEIA token buttons
ryangtanaka-org Feb 2, 2025
96db059
core team multisig link
ryangtanaka-org Feb 2, 2025
262db4a
Merge branch 'main' into teiaUIupdate
ryangtanaka-org Feb 3, 2025
9afa4d7
remove ====
Zir0h Feb 4, 2025
ed6862c
this was moved to constants.ts in 6d11464a355d6371704dfe5a0afdf119d47…
Zir0h Feb 4, 2025
8922c52
load .md pages with ReactComponent instead
Zir0h Feb 4, 2025
04dc10d
change donate logic
Zir0h Feb 4, 2025
7dbb22b
fixed an oopsie (accidentally deleted a Tezos.wallet.batch)
Zir0h Feb 4, 2025
fb375ed
sync before sending donation
Zir0h Feb 4, 2025
ac02ce7
removed an always failing rpc node check
Zir0h Feb 4, 2025
1bb9424
change treasury address to the core team multisig address
Zir0h Feb 4, 2025
00d5149
use DAO_TREASURY_CONTRACT for donations
Zir0h Feb 5, 2025
a485e9d
put back default start feed
Zir0h Feb 5, 2025
fdd366d
update markdown styling
Zir0h Feb 6, 2025
15d62b6
try to get li markers back
Zir0h Feb 6, 2025
ab8b04f
like this seems to work :sweat_smile:
Zir0h Feb 6, 2025
32252f3
hack to fix the dropdown menu, now I wait until I get yelled at by a …
Zir0h Feb 6, 2025
c3859ea
don't need this
Zir0h Feb 6, 2025
c415578
use tzkt calls from api.ts instead
Zir0h Feb 6, 2025
c72432c
put new links in the footer
Zir0h Feb 11, 2025
285f435
move about/faq to the left
Zir0h Feb 11, 2025
50e0c47
vite build messes up the order of css?
Zir0h Feb 11, 2025
3eafdb6
force small font
Zir0h Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/atoms/button/DonateButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { useUserStore } from '@context/userStore'
import { DAO_TREASURY_CONTRACT } from '@constants'

import { useState } from 'react'
import styles from './index.module.scss' // Import the SCSS module

// Donation input component with user-defined amount
const DonateInput = () => {
const [amount, setAmount] = useState('')
const [donate] = useUserStore((st) => [st.donate])

const handleAmountChange = (event) => {
setAmount(event.target.value)
}

const handleDonateClick = () => {
const amountAsNumber = parseFloat(amount)
if (isNaN(amountAsNumber) || amountAsNumber <= 0) {
alert('Please enter a valid donation amount')
return
}
donate(amountAsNumber, DAO_TREASURY_CONTRACT)
}

return (
<div className={styles.daoDonateButton}>
<h4>Donate to DAO Treasury</h4>
<p>Address: {DAO_TREASURY_CONTRACT}</p>
<input
type="number"
value={amount}
onChange={handleAmountChange}
placeholder="Enter Number in XTZ"
inputMode="decimal" // This makes the on-screen keyboard show numbers on mobile
pattern="[0-9]*" // This allows only numbers to be entered
min="0"
className={styles.donateInput}
/>
<br />
<input
type="button"
value={`Donate ${amount} XTZ`}
onClick={handleDonateClick}
className={styles.donateButton}
/>
</div>
)
}

export default DonateInput
104 changes: 104 additions & 0 deletions src/atoms/button/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,107 @@ $border: 2px;
text-decoration: none;
}
}

/* Styles for the DonateInput component */
.daoDonateButton {
font-family: var(--text-font);
max-width: 300px;
margin: 0 auto;
padding: 20px;
border: 1px solid var(--gray-20);
border-radius: 0.1em;
background-color: var(--gray-4);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
transition: var(--body-transition);

h4 {
margin: 0 0 10px;
font-size: 18px;
color: var(--text-color);
}

p {
margin: 0 0 15px;
font-size: 14px;
color: var(--gray-60);
}

.donateInput {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid var(--gray-20);
border-radius: 0.1em;
font-size: 16px;
box-sizing: border-box;
background-color: var(--background-color);
color: var(--text-color);
transition: var(--body-transition);

&:focus {
border-color: var(--primary-color);
outline: none;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
}

.donateButton {
width: 100%;
padding: 10px;
background-color: black;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s ease;

&:hover {
background-color: darken(grey, 10%);
}

&:active {
background-color: darken(black, 20%);
}
}
}

// Responsive adjustments
@include respond-to('tablet') {
.daoDonateButton {
max-width: 100%;
padding: 15px;

h4 {
font-size: 16px;
}

p {
font-size: 12px;
}

.donateInput,
.donateButton {
font-size: 14px;
}
}
}

@include respond-to('mobile') {
.daoDonateButton {
padding: 10px;

h4 {
font-size: 14px;
}

p {
font-size: 12px;
}

.donateInput,
.donateButton {
font-size: 12px;
}
}
}
9 changes: 7 additions & 2 deletions src/components/footer/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
@include respond-to('tablet') {
grid-template-rows: none;
grid-template-areas: 'Logo Copyright Menu Tools';
grid-template-columns: 1fr 2fr repeat(2, 1fr);
}
}

Expand Down Expand Up @@ -71,7 +70,12 @@
text-align: left;
align-items: flex-start;
}

.menu_label_row {
display: inline-block !important;
margin-right: 1em;
font-size: $font-small !important;
text-decoration: underline;
}
.address {
color: var(--gray-20);
}
Expand All @@ -91,6 +95,7 @@

.copyright {
grid-area: Copyright;
text-align: left;
}

.state_buttons {
Expand Down
47 changes: 37 additions & 10 deletions src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,56 @@ export const Footer = ({ menu, pin }: FooterProps) => {
<motion.footer {...transition()} className={classes_content}>
<div className={styles.logo}>
Teia DAO LLC.
<a href="https://tzkt.io/">Powered by TzKT API</a>
{menu && (
{menu && (<>
<Button
alt="teia rotating logo"
onClick={() => setLogoSeed(Math.random() * 100)}
>
<RotatingLogo theme={theme} logos={logos} seed={logoSeed} />
</Button>
)}
</div>

<div className={styles.copyright}>{language.footer.mint}</div>
{menu && (
<>
<div className={styles.menus}>
<div className={styles.menu_left}>
<div className={styles.menu_left}>
<MenuItem className={styles.menu_label} route="about" />
<MenuItem
className={styles.menu_label}
label="F.A.Q"
route="faq"
/>
</div>
</>
)}
<a href="https://tzkt.io/">Powered by TzKT API</a>
</div>
<div className={styles.copyright}>
<div>
{language.footer.mint}
</div>
<div>
<MenuItem
className={styles.menu_label_row}
label="Core Values"
route="corevalues"
/>
<MenuItem
className={styles.menu_label_row}
label="Code of Conduct"
route="codeofconduct"
/>
<MenuItem
className={styles.menu_label_row}
label="Terms and Conditions"
route="terms"
/>
<MenuItem
className={styles.menu_label_row}
label="Privacy Policy"
route="privacypolicy"
/>
</div>
</div>
{menu && (
<>
<div className={styles.menus}>

<Line vertical />

<div className={styles.menu_right}>
Expand Down
1 change: 0 additions & 1 deletion src/components/form/FormFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const FormFields = ({ value, field, error, register, control }) => {
const [showVisualizer, setShowVisualizer] = useState(false)
const [audioBlob, setAudioBlob] = useState(null)
const visualizerRef = useRef(null)

const getArtistText = (userInfo, address) => {
if (userInfo?.name) {
return `${userInfo.name} (${address})`
Expand Down
21 changes: 16 additions & 5 deletions src/components/header/feed_toolbar/FeedToolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useLocalSettings } from '@context/localSettingsStore'
import { useLocation, useNavigate } from 'react-router'
import { Line } from '@atoms/line'
import { shallow } from 'zustand/shallow'
import { useUserStore } from '@context/userStore'
import { DEFAULT_START_FEED } from '@constants'

// const MediaFilter = ({ label, tagline }) => {
Expand All @@ -23,12 +24,13 @@ import { DEFAULT_START_FEED } from '@constants'
// }

const locationMap = new Map([
['---sort_feeds', 'Sort Feeds'],
['/feed/sales', 'Recent Sales'],
['/feed/random', 'Random'],
['/feed/newobjkts', 'New OBJKTs'],
['/feed/friends', 'Friends'],
// separator
['---fund_feeds', 'fund_feeds'],
['---fund_feeds', 'Event Feeds'],
['/feed/art4artists', 'Art4Artists'],
['/feed/tez4pal', '🇵🇸 Tez4Pal'],
['/feed/morocco-quake-aid', '🇲🇦 Quake Aid'],
Expand All @@ -38,7 +40,7 @@ const locationMap = new Map([
['/feed/iran', '🇮🇷 Iran'],
['/feed/tezospride', '🏳️‍🌈 Tezospride'],
// separator
['---mime_feeds', 'mime_feeds'],
['---mime_feeds', 'By Format'],
['/feed/image', 'Image'],
['/feed/video', 'Video'],
['/feed/audio', 'Audio'],
Expand All @@ -62,9 +64,11 @@ export const FeedToolbar = ({ feeds_menu = false }) => {
)
const location = useLocation()
const feedLabel =
locationMap.get(location.pathname) || startFeed || DEFAULT_START_FEED

locationMap.get('/' + location.pathname.split('/').slice(1, 3).join('/')) ||
startFeed ||
DEFAULT_START_FEED
const navigate = useNavigate()
const walletAddress = useUserStore((st) => [st.address], shallow)

// TODO: finish the filtering logic
// const filters = false
Expand All @@ -83,7 +87,14 @@ export const FeedToolbar = ({ feeds_menu = false }) => {
<div className={styles.feeds_button}>
{[...locationMap.keys()].map((k) => {
if (k.startsWith('-')) {
return <Line className={styles.separator} key={k} />
return (
<>
<Line className={styles.separator} key={k} />
<span className={styles.subtitle}>
{locationMap.get(k)}
</span>
</>
)
}
if (locationNeedSync.includes(k)) {
return (
Expand Down
4 changes: 4 additions & 0 deletions src/components/header/feed_toolbar/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
padding-bottom: 1em;
}

.subtitle {
font-weight: bold;
}

.filters_container {
display: flex;
flex-direction: row;
Expand Down
8 changes: 6 additions & 2 deletions src/components/header/main_menu/MainMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export const MainMenu = () => {
{/* <MenuItem route="search" /> */}
<MenuItem className={styles.menu_label} route="search" />
<MenuItem className={styles.menu_label} route="about" />
<MenuItem className={styles.menu_label} label="F.A.Q" route="faq" />
<MenuItem
className={styles.menu_label}
label="Getting Started"
route="faq"
/>
</div>
<Line className={styles.line} vertical />
<div className={styles.menu_right}>
Expand Down Expand Up @@ -66,7 +70,7 @@ export const MainMenu = () => {

<MenuItem
className={styles.menu_label}
label="DAO governance"
label="DAO Governance"
route="dao"
/>

Expand Down
2 changes: 1 addition & 1 deletion src/components/header/main_menu/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
height: 100vh;

.content {
line-height: 3em;
line-height: 2.75em;
display: flex;
justify-content: center;
flex-direction: row;
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const MOROCCO_QUAKE_FUNDING_CONTRACT =

export const POLLS_CONTRACT = 'KT1SUExZfkmxf2fafrVgYjZGEKDete2siWoU'
export const DAO_GOVERNANCE_CONTRACT = 'KT1GHX73W5BcjbYRSZSrUJcnZE3Uw92VYF66'
export const DAO_TREASURY_CONTRACT = 'KT1J9FYz29RBQi1oGLw8uXyACrzXzV1dHuvb'
export const DAO_TOKEN_CONTRACT = 'KT1QrtA753MSv8VGxkDrKKyJniG5JtuHHbtV'
export const DAO_TOKEN_CLAIM_CONTRACT = 'KT1NrfV4e2qWqFrnrKyPTJth5wq2KP9VyBei'
export const DISTRIBUTION_MAPPING_IPFS_PATH =
Expand Down
Loading
Loading