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

Miscellaneous #922

Merged
merged 6 commits into from
Jul 12, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
node-version: 14.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn lint --max-warnings 0
- run: yarn checkTs
- run: yarn build

Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"**/__snapshots__/": true,
".nyc_output/": true,
"cypress-coverage/": true,
"coverage/": true,
".parcel-cache/": true,
"build/": true,
"build-ext/": true,
Expand Down
4 changes: 2 additions & 2 deletions src/app/state/account/saga.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { testSaga } from 'redux-saga-test-plan'
import { accountActions } from '.'
import { accountSaga, loadAccount, refreshAccountOnTransaction } from './saga'
import { accountSaga, fetchAccount, refreshAccountOnTransaction } from './saga'

describe('Account Sagas', () => {
test('accountSaga', () => {
testSaga(accountSaga)
.next()
.fork(refreshAccountOnTransaction)
.next()
.takeLatest(accountActions.fetchAccount, loadAccount)
.takeLatest(accountActions.fetchAccount, fetchAccount)
.next()
.isDone()
})
Expand Down
6 changes: 3 additions & 3 deletions src/app/state/account/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { selectAddress } from '../wallet/selectors'
import { selectAccountAddress } from './selectors'

/**
* Waits for a LoadAccount action with a specific address,
* Waits for a fetchAccount action with a specific address,
* and hydrate the state accordingly
*/
export function* loadAccount(action: PayloadAction<string>) {
export function* fetchAccount(action: PayloadAction<string>) {
const address = action.payload

yield* put(actions.setLoading(true))
Expand Down Expand Up @@ -100,5 +100,5 @@ export function* refreshAccountOnTransaction() {

export function* accountSaga() {
yield* fork(refreshAccountOnTransaction)
yield* takeLatest(actions.fetchAccount, loadAccount)
yield* takeLatest(actions.fetchAccount, fetchAccount)
}
4 changes: 2 additions & 2 deletions src/app/state/wallet/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function* rootWalletSaga() {
yield* takeEvery(walletActions.addWallet, addWallet)

// Reload balance of matching wallets when a transaction occurs
yield* fork(reloadBalanceOnTransaction)
yield* fork(refreshAccountOnTransaction)
yield* takeEvery(walletActions.fetchWallet, loadWallet)

// Allow switching between wallets
Expand Down Expand Up @@ -163,7 +163,7 @@ function* loadWallet(action: PayloadAction<Wallet>) {
* When a transaction is done, and it is related to the account we currently have in state
* refresh the data.
*/
function* reloadBalanceOnTransaction() {
function* refreshAccountOnTransaction() {
while (true) {
const { payload } = yield* take(transactionActions.transactionSent)
if (payload.type !== 'transfer') {
Expand Down
8 changes: 4 additions & 4 deletions src/styles/theme/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { grommet, Grommet, ThemeType } from 'grommet'
import { deepMerge } from 'grommet/utils'
import * as React from 'react'
import { createTheme, IDataTableStyles, ITheme } from 'react-data-table-component'
import { createTheme as dataTableCreateTheme, IDataTableStyles, ITheme } from 'react-data-table-component'
import { useSelector } from 'react-redux'

import { selectTheme } from './slice/selectors'
Expand All @@ -10,7 +10,7 @@ import { selectTheme } from './slice/selectors'
* React-data-table by default sets its own background and text colors
* we make sure that they do not override grommet's
*/
createTheme('blank', {
dataTableCreateTheme('blank', {
background: { default: 'false' },
highlightOnHover: {
default: '#88888833',
Expand Down Expand Up @@ -40,7 +40,7 @@ export const dataTableStyles: IDataTableStyles = {
},
}

const customTheme: ThemeType = {
const grommetCustomTheme: ThemeType = {
button: {
primary: {
background: {
Expand Down Expand Up @@ -127,7 +127,7 @@ const customTheme: ThemeType = {
},
}
export const ThemeProvider = (props: { children: React.ReactChild }) => {
const theme = deepMerge(grommet, customTheme)
const theme = deepMerge(grommet, grommetCustomTheme)
const mode = useSelector(selectTheme)

return (
Expand Down
26 changes: 0 additions & 26 deletions src/styles/theme/themes.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/vendors/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { addressToPublicKey } from 'app/lib/helpers'

import { sortByStatus, throwAPIErrors } from './helpers'

export function getMonitorAPIs(url: string | 'https://monitor.oasis.dev/') {
export function getMonitorAPIs(url: string | 'https://monitor.oasis.dev') {
const explorerConfig = new Configuration({
basePath: url,
...throwAPIErrors,
Expand Down
2 changes: 1 addition & 1 deletion src/vendors/oasisscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

import { throwAPIErrors, sortByStatus } from './helpers'

export function getOasisscanAPIs(url: string | 'https://api.oasisscan.com/mainnet/') {
export function getOasisscanAPIs(url: string | 'https://api.oasisscan.com/mainnet') {
const explorerConfig = new Configuration({
basePath: url,
...throwAPIErrors,
Expand Down