Skip to content

Commit 2fc8560

Browse files
author
hicetnunc2000
committed
latest
2 parents 37c4562 + bbd7038 commit 2fc8560

Some content is hidden

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

45 files changed

+6563
-37353
lines changed

1636259527044.zip

6.44 MB
Binary file not shown.

package-lock.json

Lines changed: 6515 additions & 37316 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/input/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export const Input = ({
1414
onWheel = () => null,
1515
disabled,
1616
value,
17-
pattern
17+
pattern,
18+
onKeyPress
1819
}) => (
1920
<div className={styles.container}>
2021
<label>
@@ -28,9 +29,9 @@ export const Input = ({
2829
defaultValue={value}
2930
onChange={onChange}
3031
onBlur={onBlur}
31-
disabled={disabled}
3232
pattern={pattern}
3333
onWheel={onWheel}
34+
onKeyPress={onKeyPress}
3435
/>
3536
<p>{label}</p>
3637
</label>

src/components/item-info/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ export const ItemInfo = ({
103103
<div className={styles.edition}>
104104
<div className={styles.inline}>
105105
{/* <p className={styles.issuer}>{isCollab ? 'Collaboration:' : 'Issuer:'}&nbsp;</p> */}
106-
{isCollab && (
107-
<CollabIssuerInfo address={ creatorAddress } />
108-
)}
109-
{!isCollab && (
110106
<Button
111107
to={
112108
`/tz/${creator.address}`
@@ -118,7 +114,6 @@ export const ItemInfo = ({
118114
<Primary>{walletPreview(creator.address)}</Primary>
119115
)}
120116
</Button>
121-
)}
122117
</div>
123118
{!feed && (
124119
<div>

src/pages/search/index.js

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ async function fetchSubjkts(subjkt) {
418418
//console.log(subjkt)
419419
const { errors, data } = await fetchGraphQL(`
420420
query subjktsQuery {
421-
hic_et_nunc_holder(where: { name: {_like: "%${subjkt}%"}}, order_by: {hdao_balance: desc}) {
421+
hic_et_nunc_holder(where: { name: {_ilike: "%${subjkt}%"}}, order_by: {hdao_balance: desc}) {
422422
address
423423
name
424424
hdao_balance
@@ -540,7 +540,8 @@ export class Search extends Component {
540540
{ id: 7, value: 'recent sales' },
541541
{ id: 8, value: '1D' },
542542
{ id: 9, value: '1W' },
543-
{ id: 10, value: '1M' }
543+
{ id: 10, value: '1M' },
544+
{ id: 11, value: 'ATH' }
544545
],
545546
select: [],
546547
mouse: false,
@@ -561,7 +562,7 @@ export class Search extends Component {
561562
handleChange = (e) => {
562563
this.setState({ [e.target.name]: e.target.value })
563564

564-
if (this.state.search.length >= 1) this.search()
565+
//if (this.state.search.length >= 1) this.search()
565566
}
566567

567568
update = async (e, reset) => {
@@ -579,6 +580,7 @@ export class Search extends Component {
579580
let list = await fetchDay(new Date((new Date()).getTime() - 60 * 60 * 24 * 1000).toISOString(), this.state.offset)
580581
list = list.map(e => e.token)
581582
list = [...this.state.feed, ...(list)]
583+
list = list.filter(e => !arr.includes(e.creator.address))
582584
list = _.uniqBy(list, 'id')
583585

584586
this.setState({
@@ -590,6 +592,8 @@ export class Search extends Component {
590592
let list = await fetchDay(new Date((new Date()).getTime() - 60 * 60 * 24 * 7 * 1000).toISOString(), this.state.offset)
591593
list = list.map(e => e.token)
592594
list = [...this.state.feed, ...(list)]
595+
list = list.filter(e => !arr.includes(e.creator.address))
596+
593597
list = _.uniqBy(list, 'id')
594598

595599
this.setState({
@@ -602,13 +606,26 @@ export class Search extends Component {
602606
let list = await fetchDay(new Date((new Date()).getTime() - 60 * 60 * 24 * 30 * 1000).toISOString(), this.state.offset)
603607
list = list.map(e => e.token)
604608
list = [...this.state.feed, ...(list)]
609+
list = list.filter(e => !arr.includes(e.creator.address))
610+
605611
list = _.uniqBy(list, 'id')
606612

607613
this.setState({
608614
feed: list
609615
})
610616
}
611617

618+
if (e === 'ATH') {
619+
let list = await fetchDay(new Date('2021-05-01').toISOString(), this.state.offset)
620+
list = list.map(e => e.token)
621+
list = [...this.state.feed, ...(list)]
622+
list = _.uniqBy(list, 'id')
623+
console.log('ath', list)
624+
this.setState({
625+
feed: list
626+
})
627+
}
628+
612629
if (e === 'num') {
613630
let res = await fetchFeed(Number(this.state.search) + 1 - this.state.offset)
614631
res = res.filter(e => !arr.includes(e.creator_id))
@@ -693,24 +710,25 @@ export class Search extends Component {
693710
let restricted = await getRestrictedAddresses()
694711
result = _.uniqBy([...this.state.feed, ...result], 'creator_id')
695712
result = result.filter(e => !restricted.includes(e.creator_id))
696-
this.setState({ feed: [...result], flag : true })
713+
this.setState({ feed: [...result], flag: true })
697714
}
698715

699716

700717
search = async (e) => {
701718

719+
console.log(e)
720+
702721
this.setState({ items: [], feed: [], search: e })
703722
this.setState({ subjkt: await fetchSubjkts(this.state.search) })
704723

705-
if ((this.state.subjkt[0]?.hdao_balance > 30000000) || (isFloat(Number(this.state.search)))) {
706-
console.log(isFloat(Number(this.state.search)))
707-
this.setState({ feed: await fetchCreations(this.state.subjkt[0].address, this.state.offset), select: 'creations' })
708-
} else if (!isNaN(this.state.search)) {
724+
if (!isNaN(this.state.search)) {
709725
this.setState({ feed: await fetchFeed(Number(this.state.search) + 1), select: 'num' })
710726
} else {
711727
this.setState({ feed: _.uniqBy(await fetchTag(this.state.search.toLowerCase(), 9999999), 'creator_id'), select: 'tag' })
712728
}
713729

730+
731+
console.log(this.state.feed)
714732
}
715733

716734
hoverState = (bool) => this.setState({ mouse: bool })
@@ -722,21 +740,25 @@ export class Search extends Component {
722740
this.update(this.state.select, false)
723741
}
724742

743+
handleKey = (e) => {
744+
console.log(this.state.search)
745+
if (e.key == 'Enter') this.search(this.state.search)
746+
}
747+
725748
render() {
726749

727750
return (
728751
<Page>
729752
<Container>
730753
<Padding>
731-
<Input
732-
type="text"
733-
name="search"
734-
onMouseEnter={() => this.hoverState(true)}
735-
onMouseLeave={() => this.hoverState(false)}
736-
onChange={e => this.search(e.target.value)}
737-
label="objkt id, artists, tags"
738-
placeholder="objkt id, artists, tags"
739-
/>
754+
<Input
755+
type="text"
756+
name="search"
757+
onChange={this.handleChange}
758+
label="search ↵"
759+
placeholder="search ↵"
760+
onKeyPress={this.handleKey}
761+
/>
740762
{
741763
<div style={{ marginTop: '15px' }}>
742764
{this.state.tags.map(e => <a className='tag' href='#' onClick={() => {

src/pages/search/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
margin-bottom: 6px;
88
font-size: 16px;
99
font-weight: bold;
10-
}
10+
}
11+

src/styles/IBMPlexMono-Bold.ttf

109 KB
Binary file not shown.

src/styles/IBMPlexMono-BoldItalic.ttf

115 KB
Binary file not shown.

src/styles/IBMPlexMono-ExtraLight.ttf

107 KB
Binary file not shown.
115 KB
Binary file not shown.

0 commit comments

Comments
 (0)