Skip to content

Commit 3bc4982

Browse files
committed
refactor styles
1 parent d93cda8 commit 3bc4982

Some content is hidden

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

72 files changed

+232
-44
lines changed

CONTRIBUTING.md

+1-1

src/components/button-language/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { getItem, setItem } from '../../utils/storage'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
// DO NOT ENABLE THIS JUST YET (Andre)
66
const languages = [

src/components/button-theme/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext } from 'react'
22
import { HicetnuncContext } from '../../context/HicetnuncContext'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
export const ButtonTheme = () => {
66
const context = useContext(HicetnuncContext)

src/components/button/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Link } from 'react-router-dom'
33
import classnames from 'classnames'
4-
import styles from './index.module.scss'
4+
import styles from './styles.module.scss'
55

66
export const Button = ({
77
to = null,

src/components/feed-item/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import React from 'react'
22
import { PATH } from '../../constants'
3-
import { Container, Padding } from '../layout'
3+
import { Padding } from '../layout'
44
import { Button } from '../button'
55
import { ItemInfo } from '../item-info'
66
import { renderMediaType } from '../media-types'
77
import { VisuallyHidden } from '../visually-hidden'
8-
import styles from './index.module.scss'
8+
import styles from './styles.module.scss'
99

1010
export const FeedItem = (props) => {
1111
const { token_info, token_id, owners, swaps, total_amount } = props
1212
const { mimeType, uri } = token_info.formats[0]
1313
return (
14-
<Container>
14+
<>
1515
<Button to={`${PATH.OBJKT}/${token_id}`}>
1616
<VisuallyHidden>{`Go to OBJKT: ${token_info.name}`}</VisuallyHidden>
1717
<div className={styles.container}>
@@ -32,6 +32,6 @@ export const FeedItem = (props) => {
3232
feed={true}
3333
/>
3434
</Padding>
35-
</Container>
35+
</>
3636
)
3737
}

src/components/feed-item/index.module.scss

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import '../../styles/variables.scss';
2+
@import '../../styles/layout.scss';
3+
4+
.container {
5+
position: relative;
6+
}

src/components/footer/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import { ButtonLanguage } from '../button-language'
33
import { ButtonTheme } from '../button-theme'
44
import { getLanguage } from '../../constants'
5-
import styles from './index.module.scss'
5+
import styles from './styles.module.scss'
66

77
export const Footer = () => {
88
const language = getLanguage()

src/components/header/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { fadeIn } from '../../utils/motion'
1010
import { Menu } from '../icons'
1111
import { walletPreview } from '../../utils/string'
1212
import { VisuallyHidden } from '../visually-hidden'
13-
import styles from './style.module.scss'
13+
import styles from './styles.module.scss'
1414
import { getItem, setItem } from '../../utils/storage'
1515

1616
/* import { BeaconWallet } from '@taquito/beacon-wallet'

src/components/icons/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { motion } from 'framer-motion'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
const transition = {
66
duration: 0.5,
File renamed without changes.

src/components/identicons/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import base from 'base-x'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
const alphabet58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
66
const base58 = base(alphabet58)

src/components/input/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const Input = ({
55
type = 'text',
File renamed without changes.

src/components/item-info/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PATH } from '../../constants'
33
import { Button, Primary, Purchase } from '../button'
44
import { HicetnuncContext } from '../../context/HicetnuncContext'
55
import { walletPreview } from '../../utils/string'
6-
import styles from './index.module.scss'
6+
import styles from './styles.module.scss'
77

88
const _ = require('lodash')
99

src/components/layout/container/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import classnames from 'classnames'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
export const Container = ({ children = null, large, xlarge }) => {
66
const classes = classnames({

src/components/layout/padding/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const Padding = ({ children = null }) => {
55
return <div className={styles.container}>{children}</div>

src/components/layout/page/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import { Helmet } from 'react-helmet'
33
import { VisuallyHidden } from '../../visually-hidden'
4-
import styles from './index.module.scss'
4+
import styles from './styles.module.scss'
55

66
export const Page = ({ title = 'hic et nunc', children = null }) => {
77
return (

src/components/loading/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const Loading = ({ message }) => {
55
return (

src/components/media-grid/index.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react'
2+
import { Container, Padding } from '../layout'
3+
import { Button } from '../button'
4+
import { VisuallyHidden } from '../visually-hidden'
5+
import { renderMediaType } from '../media-types'
6+
import { PATH } from '../../constants'
7+
import styles from './styles.module.scss'
8+
9+
export const MediaGrid = ({ items }) => {
10+
return (
11+
<Container large>
12+
<Padding>
13+
<div className={styles.list}>
14+
{items.map((item, index) => {
15+
const { token_info, token_id } = item
16+
const { mimeType, uri } = token_info.formats[0]
17+
18+
return (
19+
<Button to={`${PATH.OBJKT}/${token_id}`}>
20+
<VisuallyHidden>{`Go to OBJKT: ${token_info.name}`}</VisuallyHidden>
21+
<div className={styles.container}>
22+
{renderMediaType({
23+
mimeType,
24+
uri: uri.split('//')[1],
25+
metadata: item,
26+
})}
27+
</div>
28+
</Button>
29+
)
30+
})}
31+
</div>
32+
</Padding>
33+
</Container>
34+
)
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@import '../../styles/layout.scss';
2+
3+
.list {
4+
display: grid;
5+
grid-column-gap: 10px;
6+
grid-row-gap: 10px;
7+
grid-template-columns: repeat(1, minmax(0, 1fr));
8+
border: 1px dashed red;
9+
10+
@include respond-to('tablet') {
11+
grid-template-columns: repeat(2, minmax(0, 1fr));
12+
}
13+
14+
@include respond-to('desktop') {
15+
grid-template-columns: repeat(3, minmax(0, 1fr));
16+
}
17+
18+
.item {
19+
position: relative;
20+
grid-column-end: span 1; // 1/1
21+
margin-bottom: 40px;
22+
23+
@include respond-to('tablet') {
24+
grid-column-end: span 2; // 2/4
25+
margin-bottom: initial;
26+
}
27+
28+
@include respond-to('desktop') {
29+
grid-column-end: span 1; // 1/4
30+
}
31+
}
32+
}

src/components/media-types/audio/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const AudioComponent = ({ src, token_info }) => (
55
<>

src/components/media-types/glb/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useRef, useState } from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
/* DOCS: https://modelviewer.dev/ */
55
export const GLBComponent = ({ src, interactive }) => {

src/components/media-types/html/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
validateFiles,
99
} from '../../../utils/html'
1010
import { VisuallyHidden } from '../../visually-hidden'
11-
import styles from './index.module.scss'
11+
import styles from './styles.module.scss'
1212

1313
const uid = Math.round(Math.random() * 100000000).toString()
1414

src/components/media-types/html/warning.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Button, Primary } from '../../button'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export function HTMLWarning() {
55
return (

src/components/media-types/image/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { LazyLoadImage } from 'react-lazy-load-image-component'
3-
import styles from './index.module.scss'
3+
import styles from './styles.module.scss'
44

55
export const ImageComponent = ({ src }) => (
66
<div className={styles.container}>

src/components/media-types/pdf/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const PdfComponent = ({ src }) => (
55
<div className={styles.container}>

src/components/media-types/unknown/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const UnknownComponent = ({ mimeType }) => {
55
return (

src/components/media-types/vector/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useContext } from 'react'
22
import classnames from 'classnames'
33
import { HicetnuncContext } from '../../../context/HicetnuncContext'
4-
import styles from './index.module.scss'
4+
import styles from './styles.module.scss'
55

66
export const VectorComponent = ({ src, interactive, preview, token_info }) => {
77
const context = useContext(HicetnuncContext)

src/components/media-types/video/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useRef } from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const VideoComponent = ({ src, interactive, inView }) => {
55
const domElement = useRef()

src/components/menu/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import styles from './index.module.scss'
2+
import styles from './styles.module.scss'
33

44
export const Menu = ({ children = null }) => {
55
return <div className={styles.container}>{children}</div>
File renamed without changes.

src/components/mimetype-icon/index.js

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import React from 'react'
2+
import { MIMETYPE, IPFS_DIRECTORY_MIMETYPE } from '../../constants'
3+
import styles from './styles.module.scss'
4+
5+
// temporary disabling this component
6+
const DONT_USE = true
7+
8+
export const MimeTypeIcon = ({ mimeType, uri }) => {
9+
const getIcon = () => {
10+
switch (mimeType) {
11+
/* IMAGES */
12+
case MIMETYPE.BMP:
13+
case MIMETYPE.GIF:
14+
case MIMETYPE.JPEG:
15+
case MIMETYPE.PNG:
16+
case MIMETYPE.TIFF:
17+
case MIMETYPE.WEBP:
18+
return (
19+
<svg viewBox="0 0 512 512">
20+
<path d="M368,224c26.5,0,48-21.5,48-48c0-26.5-21.5-48-48-48c-26.5,0-48,21.5-48,48C320,202.5,341.5,224,368,224z" />
21+
<path d="M452,64H60c-15.6,0-28,12.7-28,28.3v327.4c0,15.6,12.4,28.3,28,28.3h392c15.6,0,28-12.7,28-28.3V92.3 C480,76.7,467.6,64,452,64z M348.9,261.7c-3-3.5-7.6-6.2-12.8-6.2c-5.1,0-8.7,2.4-12.8,5.7l-18.7,15.8c-3.9,2.8-7,4.7-11.5,4.7 c-4.3,0-8.2-1.6-11-4.1c-1-0.9-2.8-2.6-4.3-4.1L224,215.3c-4-4.6-10-7.5-16.7-7.5c-6.7,0-12.9,3.3-16.8,7.8L64,368.2V107.7 c1-6.8,6.3-11.7,13.1-11.7h357.7c6.9,0,12.5,5.1,12.9,12l0.3,260.4L348.9,261.7z" />
22+
</svg>
23+
)
24+
/* VECTOR */
25+
case MIMETYPE.SVG:
26+
return (
27+
<svg viewBox="0 0 32 32">
28+
<path d="M30,15H19v-1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v0.5c-3.1-1-5.6-3.4-6.5-6.5H7c0.6,0,1-0.4,1-1V3c0-0.6-0.4-1-1-1H3 C2.4,2,2,2.4,2,3v4c0,0.6,0.4,1,1,1h1.4c0.7,2.9,2.6,5.4,5,7H2c-0.6,0-1,0.4-1,1s0.4,1,1,1h11v1c0,0.6,0.4,1,1,1h4c0.6,0,1-0.4,1-1 v-0.5c3.1,1,5.6,3.4,6.5,6.5H25c-0.6,0-1,0.4-1,1v4c0,0.6,0.4,1,1,1h4c0.6,0,1-0.4,1-1v-4c0-0.6-0.4-1-1-1h-1.4 c-0.7-2.9-2.6-5.4-5-7H30c0.6,0,1-0.4,1-1S30.6,15,30,15z" />
29+
</svg>
30+
)
31+
/* HTML ZIP */
32+
case IPFS_DIRECTORY_MIMETYPE:
33+
case MIMETYPE.ZIP:
34+
case MIMETYPE.ZIP1:
35+
case MIMETYPE.ZIP2:
36+
return (
37+
<svg viewBox="0 0 96 96">
38+
<path d="M24.8452,25.3957a6.0129,6.0129,0,0,0-8.4487.7617L1.3974,44.1563a5.9844,5.9844,0,0,0,0,7.687L16.3965,69.8422a5.9983,5.9983,0,1,0,9.21-7.687L13.8068,48l11.8-14.1554A6,6,0,0,0,24.8452,25.3957Z" />
39+
<path d="M55.1714,12.1192A6.0558,6.0558,0,0,0,48.1172,16.83L36.1179,76.8262A5.9847,5.9847,0,0,0,40.8286,83.88a5.7059,5.7059,0,0,0,1.1835.1172A5.9949,5.9949,0,0,0,47.8828,79.17L59.8821,19.1735A5.9848,5.9848,0,0,0,55.1714,12.1192Z" />
40+
<path d="M94.6026,44.1563,79.6035,26.1574a5.9983,5.9983,0,1,0-9.21,7.687L82.1932,48l-11.8,14.1554a5.9983,5.9983,0,1,0,9.21,7.687L94.6026,51.8433A5.9844,5.9844,0,0,0,94.6026,44.1563Z" />
41+
</svg>
42+
)
43+
/* VIDEOS */
44+
case MIMETYPE.MP4:
45+
case MIMETYPE.OGV:
46+
case MIMETYPE.QUICKTIME:
47+
case MIMETYPE.WEBM:
48+
return (
49+
<svg viewBox="0 0 16 18">
50+
<path d="M14,0 L14,2 L12,2 L12,0 L4,0 L4,2 L2,2 L2,0 L0,0 L0,18 L2,18 L2,16 L4,16 L4,18 L12,18 L12,16 L14,16 L14,18 L16,18 L16,0 L14,0 L14,0 Z M4,14 L2,14 L2,12 L4,12 L4,14 L4,14 Z M4,10 L2,10 L2,8 L4,8 L4,10 L4,10 Z M4,6 L2,6 L2,4 L4,4 L4,6 L4,6 Z M14,14 L12,14 L12,12 L14,12 L14,14 L14,14 Z M14,10 L12,10 L12,8 L14,8 L14,10 L14,10 Z M14,6 L12,6 L12,4 L14,4 L14,6 L14,6 Z" />
51+
</svg>
52+
)
53+
/* 3D */
54+
case MIMETYPE.GLB:
55+
case MIMETYPE.GLTF:
56+
return (
57+
<svg viewBox="0 0 20 20">
58+
<path d="M 10.005859 0.5 A 0.50083746 0.50083746 0 0 0 9.7539062 0.56445312 L 1.7539062 5.0644531 A 0.50083746 0.50083746 0 0 0 1.5 5.5 L 1.5 14.5 A 0.50083746 0.50083746 0 0 0 1.7539062 14.935547 L 9.7539062 19.435547 A 0.50083746 0.50083746 0 0 0 10.246094 19.435547 L 18.246094 14.935547 A 0.50083746 0.50083746 0 0 0 18.5 14.5 L 18.5 5.5 A 0.50083746 0.50083746 0 0 0 18.246094 5.0644531 L 10.246094 0.56445312 A 0.50083746 0.50083746 0 0 0 10.005859 0.5 z M 10 1.5742188 L 16.978516 5.5 L 10 9.4257812 L 3.0214844 5.5 L 10 1.5742188 z M 2.5 6.3554688 L 9.5 10.292969 L 9.5 18.144531 L 2.5 14.207031 L 2.5 6.3554688 z M 17.5 6.3554688 L 17.5 14.207031 L 10.5 18.144531 L 10.5 10.292969 L 17.5 6.3554688 z" />
59+
</svg>
60+
)
61+
/* AUDIO */
62+
case MIMETYPE.MP3:
63+
case MIMETYPE.OGA:
64+
return (
65+
<svg viewBox="0 0 64 64">
66+
<path d="M23.727,16.403v4.84v5.058v14.236c-1.268-0.777-2.754-1.233-4.35-1.233c-4.612,0-8.353,3.74-8.353,8.349 c0,4.614,3.74,8.354,8.353,8.354c4.61,0,8.349-3.739,8.35-8.352h0V25.151l21.25-6.109V33.33c-1.268-0.777-2.754-1.233-4.35-1.233 c-4.614,0-8.353,3.739-8.353,8.348c0,4.613,3.739,8.354,8.353,8.354c4.344,0,7.914-3.325,8.31-7.57h0.04V17.892v-3.586V7.993 L23.727,16.403z" />
67+
</svg>
68+
)
69+
default:
70+
return null
71+
}
72+
}
73+
74+
if (DONT_USE) {
75+
return null
76+
}
77+
return <div className={styles.container}>{getIcon()}</div>
78+
}

0 commit comments

Comments
 (0)