Skip to content

Commit

Permalink
Merge pull request #59 from poap-xyz/release/v1.4.0
Browse files Browse the repository at this point in the history
Release v1.4.0
  • Loading branch information
jm42 authored May 25, 2023
2 parents b7e2063 + c932bcd commit 4097c4c
Show file tree
Hide file tree
Showing 23 changed files with 893 additions and 195 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@poap-xyz/poap-family",
"version": "1.3.5",
"version": "1.4.0",
"author": {
"name": "POAP",
"url": "https://poap.xyz"
Expand Down
122 changes: 60 additions & 62 deletions src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Admin from './Admin'
import Addresses from '../pages/Addresses'
import { AdminProvider } from '../stores/admin'
import { SettingsProvider } from '../stores/cache'
import { EnsProvider, ReverseEnsProvider } from '../stores/ethereum'
import { EnsProvider } from '../stores/ethereum'
import { HTMLProvider } from '../stores/html'
import '../styles/fonts.css'
import '../styles/app.css'
Expand All @@ -28,67 +28,65 @@ function App() {
<Analytics>
<AdminProvider>
<SettingsProvider>
<ReverseEnsProvider>
<EnsProvider>
<RouterProvider
router={createBrowserRouter([
{
path: '/',
element: <Root />,
errorElement: <PageError />,
children: [
{
index: true,
element: <Home />,
},
{
path: '/r/event/:eventId',
loader: eventRedirect,
},
{
path: '/event/:eventId',
loader: eventLoader,
element: <Event />,
errorElement: <PageError />,
},
{
path: '/r/events/:eventIds',
loader: eventsRedirect,
},
{
path: '/events/:eventIds',
loader: eventsLoader,
element: <Events />,
errorElement: <EventsPageError />,
},
{
path: '/addresses',
element: <Addresses />,
},
{
path: '/last',
element: <Last />,
},
{
path: '/settings',
element: <Settings />,
},
{
element: <Admin />,
children: [
{
path: '/feedback',
element: <FeedbackList />,
},
],
},
],
},
])}
fallbackElement={<CenterPage><Loading /></CenterPage>}
/>
</EnsProvider>
</ReverseEnsProvider>
<EnsProvider>
<RouterProvider
router={createBrowserRouter([
{
path: '/',
element: <Root />,
errorElement: <PageError />,
children: [
{
index: true,
element: <Home />,
},
{
path: '/r/event/:eventId',
loader: eventRedirect,
},
{
path: '/event/:eventId',
loader: eventLoader,
element: <Event />,
errorElement: <PageError />,
},
{
path: '/r/events/:eventIds',
loader: eventsRedirect,
},
{
path: '/events/:eventIds',
loader: eventsLoader,
element: <Events />,
errorElement: <EventsPageError />,
},
{
path: '/addresses',
element: <Addresses />,
},
{
path: '/last',
element: <Last />,
},
{
path: '/settings',
element: <Settings />,
},
{
element: <Admin />,
children: [
{
path: '/feedback',
element: <FeedbackList />,
},
],
},
],
},
])}
fallbackElement={<CenterPage><Loading /></CenterPage>}
/>
</EnsProvider>
</SettingsProvider>
</AdminProvider>
</Analytics>
Expand Down
39 changes: 12 additions & 27 deletions src/components/AddressCollector.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
import { useContext } from 'react'
import { POAP_SCAN_URL } from '../models/poap'
import { ReverseEnsContext } from '../stores/ethereum'
import '../styles/collector.css'

function AddressCollector({ address, ens, bigEns = false, short = false, linkToScan = true }) {
function AddressCollector({ address, ens, bigEns = false, short = false }) {
const { ensNames } = useContext(ReverseEnsContext)

return (
<div className={`collector ${bigEns ? 'big-ens' : 'big-address'}`}>
<div className="collector-address">
{linkToScan
? (
<a href={`https://app.poap.xyz/scan/${address}`}>
{address && (
<code className="address short" style={{ display: short ? 'inline' : 'none' }} title={address}>
{address.substring(0, 10)}{address.substr(-8)}
</code>
)}
{!short && address && (
<code className="address long" style={{ display: short ? 'none' : 'inline' }}>{address}</code>
)}
</a>
)
: (
<>
{address && (
<code className="address short" style={{ display: short ? 'inline' : 'none' }} title={address}>
{address.substring(0, 10)}{address.substr(-8)}
</code>
)}
{!short && address && (
<code className="address long" style={{ display: short ? 'none' : 'inline' }}>{address}</code>
)}
</>
)
}
<a href={`${POAP_SCAN_URL}/${address}`}>
{address && (
<code className="address short" style={{ display: short ? 'inline' : 'none' }} title={address}>
{address.substring(0, 10)}{address.substr(-8)}
</code>
)}
{!short && address && (
<code className="address long" style={{ display: short ? 'none' : 'inline' }}>{address}</code>
)}
</a>
</div>
{(ens || (address && ensNames[address])) && (
<div className="collector-ens">
Expand Down
41 changes: 33 additions & 8 deletions src/components/AddressOwner.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
import { useContext } from 'react'
import { SettingsContext } from '../stores/cache'
import { ReverseEnsContext } from '../stores/ethereum'
import { POAP_SCAN_URL } from '../models/poap'
import POAP_Stamp from '../images/POAP_Stamp.svg'
import TokenImage from './TokenImage'
import ButtonAddressProfile from './ButtonAddressProfile'
import '../styles/owner.css'

function AddressOwner({ owner, ownerEvents, eventIds, linkToScan = true }) {
function AddressOwner({
address,
events,
eventIds,
inCommonEventIds = [],
linkToScan = false,
}) {
const { ensNames } = useContext(ReverseEnsContext)
const { settings } = useContext(SettingsContext)

return (
<div className="owner">
<div className="owner-name">
{linkToScan
{settings && settings.openProfiles
? (
<a href={`https://app.poap.xyz/scan/${owner}`}>
{owner in ensNames ? <span className="ens" title={owner}>{ensNames[owner]}</span> : <code>{owner}</code>}
<ButtonAddressProfile
address={address}
events={events}
inCommonEventIds={inCommonEventIds}
/>
)
: (
<a href={`${POAP_SCAN_URL}/${address}`} target="_blank" rel="noopener noreferrer">
{address in ensNames
? <span className="ens" title={address}>{ensNames[address]}</span>
: <code>{address}</code>
}
</a>
)
: (owner in ensNames ? <span className="ens" title={owner}>{ensNames[owner]}</span> : <code>{owner}</code>)
}
</div>
{ownerEvents && typeof ownerEvents === 'object' && eventIds && Array.isArray(eventIds) && (
{linkToScan && (!settings || settings.openProfiles) && (
<a className="owner-scan" href={`${POAP_SCAN_URL}/${address}`} target="_blank" rel="noopener noreferrer">
<img src={POAP_Stamp} alt={`Scan ${address}`} />
</a>
)}
{events && typeof events === 'object' && eventIds && Array.isArray(eventIds) && (
<div className="owner-events">
{eventIds.map(
(eventId) => eventId in ownerEvents
? <TokenImage key={eventId} event={ownerEvents[eventId]} size={18} resize={true} />
(eventId) => eventId in events
? <TokenImage key={eventId} event={events[eventId]} size={18} resize={true} />
: <div key={eventId} className="owner-event-empty">{' '}</div>
)}
</div>
Expand Down
Loading

0 comments on commit 4097c4c

Please sign in to comment.