This commit is contained in:
ntr committed 2023-01-26 15:24:05 +11:00
1 parent b91f877045
commit f76ceb011e
11 files changed
+56 -52

No files matched your search

+11 -7
View File
@@ -8,23 +8,27 @@ module.exports = {
"build/" "build/"
], ],
rules: { rules: {
'arrow-body-style': [0],
'max-len': ['error', 120],
'no-console': [0],
'no-multi-spaces': [0],
// prevents stupid complaints a la // prevents stupid complaints a la
// (req) { // (req) {
// req.something = x; // req.something = x;
// } // }
'no-param-reassign': [2, { props: false }], 'no-param-reassign': [2, { props: false }],
'no-multi-spaces': [0],
'max-len': ['error', 120],
'import/no-extraneous-dependencies': [0],
'prefer-arrow-callback': [0],
'arrow-body-style': [0],
'no-return-assign': 0, 'no-return-assign': 0,
'no-console': [0],
'prefer-arrow-callback': [0],
// i like loops // i like loops
'no-plusplus': [0], 'no-plusplus': [0],
'no-await-in-loop': [0], 'no-await-in-loop': [0],
indent: ['error', 4], indent: ['error', 4],
'keyword-spacing': ['error'], 'keyword-spacing': ['error'],
'key-spacing': ['error'], 'key-spacing': ['error'],
}, },
+1 -1
View File
@@ -6,7 +6,7 @@
"scripts": { "scripts": {
"build": "preact build --no-prerender", "build": "preact build --no-prerender",
"start": "preact --no-clear watch", "start": "preact --no-clear watch",
"lint": "eslint src" "lint": "eslint --fix src"
}, },
"dependencies": { "dependencies": {
"@reduxjs/toolkit": "^1.8.5", "@reduxjs/toolkit": "^1.8.5",
+1 -1
View File
@@ -72,7 +72,7 @@ const Nav = () => {
return ( return (
<header> <header>
{user ? nav() : anonNav()} {user ? nav() : anonNav()}
{showAdmin(user) ? adminNav() : <div></div>} {showAdmin(user) ? adminNav() : <div />}
{user ? userNav() : null} {user ? userNav() : null}
</header> </header>
); );
+1 -1
View File
@@ -65,7 +65,7 @@ export default function OfferGroup(group, i) {
return ( return (
<div class="offer" key={i}> <div class="offer" key={i}>
<section> <section>
<h3>{group.details.artists_sort} - {group.details.title} <a href={group.details.uri} target="_blank"><ExternalLink /></a></h3> <h3>{group.details.artists_sort} - {group.details.title} <a href={group.details.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
<div class='alt-text details'> <div class='alt-text details'>
{group.details.year} - {detailText} {group.details.year} - {detailText}
</div> </div>
+1 -1
View File
@@ -29,7 +29,7 @@ export default function Offer(offer) {
return ( return (
<div class="offer"> <div class="offer">
<section> <section>
<h3>{details.artists_sort} - {details.title} <a href={details.uri} target="_blank"><ExternalLink /></a></h3> <h3>{details.artists_sort} - {details.title} <a href={details.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
<div class='alt-text' >{details.year}</div> <div class='alt-text' >{details.year}</div>
<div class='alt-text'>{details.formats[0].descriptions.join(' ')}</div> <div class='alt-text'>{details.formats[0].descriptions.join(' ')}</div>
<div class='number'>mcrates price: ${offer.total}</div> <div class='number'>mcrates price: ${offer.total}</div>
+1 -1
View File
@@ -27,7 +27,7 @@ function Want(want) {
return ( return (
<article key={r.id}> <article key={r.id}>
<div> <div>
<h3>{r.artists_sort} - {r.title} <a href={r.uri} target="_blank"><ExternalLink /></a></h3> <h3>{r.artists_sort} - {r.title} <a href={r.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
</div> </div>
<img src={r.thumb} /> <img src={r.thumb} />
<div class='details'> <div class='details'>
+2 -2
View File
@@ -15,8 +15,8 @@ declare module 'axios' {
} }
const api = axios.create({ const api = axios.create({
baseURL: '/api', baseURL: '/api',
withCredentials: true withCredentials: true
}); });
function onSuccess(response) { function onSuccess(response) {
+2 -2
View File
@@ -34,7 +34,7 @@ function Item({ item }) {
return ( return (
<div key={item.id} class={bold}> <div key={item.id} class={bold}>
<a href={item.listing.data.uri} target="_blank" > <a href={item.listing.data.uri} target="_blank" rel="noreferrer" >
<h4>{item.listing.data.release.description}</h4> <h4>{item.listing.data.release.description}</h4>
</a> </a>
<h5>{item.user.email}</h5> <h5>{item.user.email}</h5>
@@ -53,7 +53,7 @@ function SellerGroup(group) {
return ( return (
<div class="bundle"> <div class="bundle">
<section> <section>
<h2>{group.username} - {group.seller}</h2> <h2>{group.username} - {group.seller}</h2>
<h3>{ready} / {group.offers.length} offers</h3> <h3>{ready} / {group.offers.length} offers</h3>
<h4>Ships: {group.mentionsAustralia && 'AU'} {group.mentionsWorldwide && 'WORLD'}</h4> <h4>Ships: {group.mentionsAustralia && 'AU'} {group.mentionsWorldwide && 'WORLD'}</h4>
+1 -1
View File
@@ -93,7 +93,7 @@ const Login = ({ mode }) => {
<input type="password" name="password" id="password" /> <input type="password" name="password" id="password" />
</div> </div>
<div class="item"> <div class="item">
<input type="submit" value="login"/> <input type="submit" value="login" />
</div> </div>
</form> </form>
<button onClick={gotoRegister}> create account </button> <button onClick={gotoRegister}> create account </button>
+2 -2
View File
@@ -27,7 +27,7 @@ function Result(r, wants) {
<article key={r.id}> <article key={r.id}>
<button onClick={onClick} disabled={added} class={classes} >{btnText}</button> <button onClick={onClick} disabled={added} class={classes} >{btnText}</button>
<div> <div>
<h3>{r.title} <a href={`https://discogs.com${r.uri}`} target="_blank"><ExternalLink /></a></h3> <h3>{r.title} <a href={`https://discogs.com${r.uri}`} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
<h5 class='alt-text' >{r.year}</h5> <h5 class='alt-text' >{r.year}</h5>
<h5 class='alt-text'>{r.country}</h5> <h5 class='alt-text'>{r.country}</h5>
<h5 class='alt-text'>{r.format.join(' ')}</h5> <h5 class='alt-text'>{r.format.join(' ')}</h5>
@@ -89,7 +89,7 @@ const User = () => {
: null; : null;
const infoEl = infoText const infoEl = infoText
? <article><div></div><div>{infoText}</div></article> ? <article><div /><div>{infoText}</div></article>
: null; : null;
return ( return (
+33 -33
View File
@@ -2,58 +2,58 @@ import { createStore, combineReducers } from 'redux'
import { configureStore, createSlice } from '@reduxjs/toolkit' import { configureStore, createSlice } from '@reduxjs/toolkit'
export const userState = createSlice({ export const userState = createSlice({
name: 'user', name: 'user',
initialState: null, initialState: null,
reducers: { reducers: {
set: (state, action) => action.payload set: (state, action) => action.payload
}, },
}); });
export const offersState = createSlice({ export const offersState = createSlice({
name: 'offers', name: 'offers',
initialState: null, initialState: null,
reducers: { reducers: {
set: (state, action) => action.payload set: (state, action) => action.payload
}, },
}); });
export const acpOffersState = createSlice({ export const acpOffersState = createSlice({
name: 'acpOffers', name: 'acpOffers',
initialState: [], initialState: [],
reducers: { reducers: {
set: (state, action) => action.payload set: (state, action) => action.payload
}, },
}); });
export const wantsState = createSlice({ export const wantsState = createSlice({
name: 'wants', name: 'wants',
initialState: null, initialState: null,
reducers: { reducers: {
set: (state, action) => action.payload set: (state, action) => action.payload
}, },
}); });
export const wsState = createSlice({ export const wsState = createSlice({
name: 'ws', name: 'ws',
initialState: null, initialState: null,
reducers: { reducers: {
set: (state, action) => action.payload set: (state, action) => action.payload
}, },
}); });
const reducer = combineReducers({ const reducer = combineReducers({
offers: offersState.reducer, offers: offersState.reducer,
wants: wantsState.reducer, wants: wantsState.reducer,
ws: wsState.reducer, ws: wsState.reducer,
user: userState.reducer, user: userState.reducer,
acpOffers: acpOffersState.reducer, acpOffers: acpOffersState.reducer,
}); });
const store = createStore( const store = createStore(
reducer, reducer,
// @ts-ignore -- devtools window exists on dev // @ts-ignore -- devtools window exists on dev
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
); );
export default store; export default store;