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

feat: add logo #353

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
82 changes: 82 additions & 0 deletions src/@images/deltaDAO_Logo_small_RGB_positiv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/@utils/aquarius/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '../../@types/aquarius/SearchQuery'
import { transformAssetToAssetSelection } from '../assetConvertor'
import addressConfig from '../../../address.config'
import { isValidDid } from '@utils/ddo'

export interface UserSales {
id: string
Expand Down Expand Up @@ -178,6 +179,8 @@ export async function getAsset(
cancelToken: CancelToken
): Promise<Asset> {
try {
if (!isValidDid(did)) return

const response: AxiosResponse<Asset> = await axios.get(
`${metadataCacheUri}/api/aquarius/assets/ddo/${did}`,
{ cancelToken }
Expand Down
2 changes: 1 addition & 1 deletion src/@utils/ddo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { checkJson } from './codemirror'

export function isValidDid(did: string): boolean {
const regex = /did:op:[A-Za-z0-9]{64}/
const regex = /^did:op:[A-Za-z0-9]{64}$/
return regex.test(did)
}

Expand Down
16 changes: 16 additions & 0 deletions src/components/@shared/Page/PageHeader.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
hyphens: auto;
}

.homeTitleContainer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.homeTitleContainer h1 {
margin-bottom: calc(var(--spacer) / 2);
}

.homeTitleContainer h1 span {
display: block;
}
Expand All @@ -38,6 +49,11 @@
margin-bottom: 0;
}

.homeTitleContainer svg {
width: 15rem;
height: 5rem;
}

.center,
.search {
margin-left: auto;
Expand Down
8 changes: 8 additions & 0 deletions src/components/@shared/Page/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames/bind'
import styles from './PageHeader.module.css'
import Markdown from '@shared/Markdown'
import SearchBar from '@components/Header/SearchBar'
import DeltaDAOLogo from '@images/deltaDAO_Logo_small_RGB_positiv.svg'

const cx = classNames.bind(styles)

Expand Down Expand Up @@ -35,6 +36,13 @@ export default function PageHeader({
</span>
))}
</h1>
<a
href="https://delta-dao.com/"
target="_blank"
rel="noreferrer noopener"
>
<DeltaDAOLogo />
</a>
</div>
) : (
<h1 className={styles.title}>{title}</h1>
Expand Down
8 changes: 5 additions & 3 deletions src/components/@shared/Price/PriceUnit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ export default function PriceUnit({
className,
size = 'small',
symbol,
decimals
decimals,
explicitZero
}: {
price: number
className?: string
size?: 'small' | 'mini' | 'large'
symbol?: string
decimals?: string
explicitZero?: boolean
}): ReactElement {
const { locale } = useUserPreferences()

return (
<div className={`${styles.price} ${styles[size]} ${className}`}>
{price === 0 ? (
{price === 0 && !explicitZero ? (
<div>Free</div>
) : !price || Number.isNaN(price) ? (
) : (!price && price !== 0) || Number.isNaN(price) ? (
<div>-</div>
) : (
<div>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Asset/AssetActions/Compute/PriceOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Tooltip from '@shared/atoms/Tooltip'
import styles from './PriceOutput.module.css'
import { MAX_DECIMALS } from '@utils/constants'
import Decimal from 'decimal.js'
import { useWeb3 } from '@context/Web3'

interface PriceOutputProps {
hasPreviousOrder: boolean
Expand Down Expand Up @@ -52,6 +51,7 @@ function Row({
symbol={symbol}
size="small"
className={styles.price}
explicitZero
/>
<span className={styles.timeout}>
{timeout &&
Expand Down Expand Up @@ -90,11 +90,11 @@ export default function PriceOutput({
<div key={item.symbol}>
<PriceUnit
price={Number(item.value)}
symbol={
index < totalPrices.length - 1 ? `${item.symbol} & ` : item.symbol
}
symbol={item.symbol}
size="small"
explicitZero
/>
{index < totalPrices.length - 1 && <>&nbsp;{'&'}&nbsp;</>}
</div>
))}
<Tooltip
Expand Down