chore: Linter issues
This commit is contained in:
parent
d51dbaea37
commit
2512765c49
22 changed files with 55 additions and 92 deletions
|
@ -13,16 +13,11 @@ export function ApikeyModel(tools, models) {
|
||||||
/*
|
/*
|
||||||
* See utils/model-decorator.mjs for details
|
* See utils/model-decorator.mjs for details
|
||||||
*/
|
*/
|
||||||
return decorateModel(
|
return decorateModel(this, tools, {
|
||||||
this,
|
|
||||||
tools,
|
|
||||||
{
|
|
||||||
name: 'apikey',
|
name: 'apikey',
|
||||||
encryptedFields: ['name'],
|
encryptedFields: ['name'],
|
||||||
models: ['user'],
|
models: ['user'],
|
||||||
},
|
})
|
||||||
models
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -190,7 +190,7 @@ BookmarkModel.prototype.userBookmarks = async function (uid) {
|
||||||
log.warn(`Failed to search bookmarks for user ${uid}: ${err}`)
|
log.warn(`Failed to search bookmarks for user ${uid}: ${err}`)
|
||||||
}
|
}
|
||||||
const list = []
|
const list = []
|
||||||
for (const bookmark of bookmarks) list.push(this.bookmark)
|
for (const bookmark of bookmarks) list.push(bookmark)
|
||||||
|
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { log } from './log.mjs'
|
import { log } from './log.mjs'
|
||||||
import { website, exports } from '../config.mjs'
|
import { website, exports } from '../config.mjs'
|
||||||
import { randomString } from './crypto.mjs'
|
import { randomString } from './crypto.mjs'
|
||||||
import path from 'path'
|
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -11,16 +11,16 @@ import { flowTests } from './flow.mjs'
|
||||||
import { setup } from './shared.mjs'
|
import { setup } from './shared.mjs'
|
||||||
|
|
||||||
const runTests = async (...params) => {
|
const runTests = async (...params) => {
|
||||||
//await userTests(...params)
|
await userTests(...params)
|
||||||
//await mfaTests(...params)
|
await mfaTests(...params)
|
||||||
//await apikeyTests(...params)
|
await apikeyTests(...params)
|
||||||
//await accountTests(...params)
|
await accountTests(...params)
|
||||||
//await setTests(...params)
|
await setTests(...params)
|
||||||
await bookmarkTests(...params)
|
await bookmarkTests(...params)
|
||||||
//await curatedSetTests(...params)
|
await curatedSetTests(...params)
|
||||||
//await patternTests(...params)
|
await patternTests(...params)
|
||||||
//await subscriberTests(...params)
|
await subscriberTests(...params)
|
||||||
//await flowTests(...params)
|
await flowTests(...params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load initial data required for tests
|
// Load initial data required for tests
|
||||||
|
|
|
@ -4,8 +4,6 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { nsMerge, capitalize } from 'shared/utils.mjs'
|
import { nsMerge, capitalize } from 'shared/utils.mjs'
|
||||||
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
import { freeSewingConfig } from 'shared/config/freesewing.config.mjs'
|
||||||
import { siteConfig } from 'site/site.config.mjs'
|
import { siteConfig } from 'site/site.config.mjs'
|
||||||
// Hooks
|
|
||||||
import { useTranslation } from 'next-i18next'
|
|
||||||
// Components
|
// Components
|
||||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
||||||
|
@ -34,17 +32,13 @@ const DynamicPlatform = dynamic(
|
||||||
* when path and locale come from static props (as here)
|
* when path and locale come from static props (as here)
|
||||||
* or set them manually.
|
* or set them manually.
|
||||||
*/
|
*/
|
||||||
const AccountPage = ({ page, platform }) => {
|
const AccountPage = ({ page, platform }) => (
|
||||||
const { t } = useTranslation(ns)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageWrapper {...page} title={capitalize(platform)}>
|
<PageWrapper {...page} title={capitalize(platform)}>
|
||||||
<DynamicAuthWrapper>
|
<DynamicAuthWrapper>
|
||||||
<DynamicPlatform platform={platform} />
|
<DynamicPlatform platform={platform} />
|
||||||
</DynamicAuthWrapper>
|
</DynamicAuthWrapper>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
export default AccountPage
|
export default AccountPage
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||||
import { nsMerge } from 'shared/utils.mjs'
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
// Hooks
|
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Components
|
// Components
|
||||||
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
||||||
|
@ -32,17 +31,13 @@ const DynamicGithub = dynamic(
|
||||||
* when path and locale come from static props (as here)
|
* when path and locale come from static props (as here)
|
||||||
* or set them manually.
|
* or set them manually.
|
||||||
*/
|
*/
|
||||||
const AccountPage = ({ page }) => {
|
const AccountPage = ({ page }) => (
|
||||||
const { t } = useTranslation(ns)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<PageWrapper {...page} title="GitHub">
|
<PageWrapper {...page} title="GitHub">
|
||||||
<DynamicAuthWrapper>
|
<DynamicAuthWrapper>
|
||||||
<DynamicGithub title />
|
<DynamicGithub title />
|
||||||
</DynamicAuthWrapper>
|
</DynamicAuthWrapper>
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
export default AccountPage
|
export default AccountPage
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { nsMerge } from 'shared/utils.mjs'
|
import { nsMerge } from 'shared/utils.mjs'
|
||||||
// Hooks
|
// Hooks
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext, useCallback } from 'react'
|
import { useState, useCallback } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { useDropzone } from 'react-dropzone'
|
import { useDropzone } from 'react-dropzone'
|
||||||
import { cloudflareImageUrl } from 'shared/utils.mjs'
|
import { cloudflareImageUrl } from 'shared/utils.mjs'
|
||||||
|
@ -11,7 +11,6 @@ import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs'
|
||||||
import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
import { SaveSettingsButton } from 'shared/components/buttons/save-settings-button.mjs'
|
||||||
import { DownloadIcon } from 'shared/components/icons.mjs'
|
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
|
@ -32,11 +31,6 @@ export const ImgSettings = ({ title = false, welcome = false }) => {
|
||||||
acceptedFiles.forEach((file) => reader.readAsDataURL(file))
|
acceptedFiles.forEach((file) => reader.readAsDataURL(file))
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const imageFromUrl = async () => {
|
|
||||||
const result = await backend.uploadImage({ type, subId, slug, url })
|
|
||||||
if (result.success) setImg(result.data.imgId)
|
|
||||||
}
|
|
||||||
|
|
||||||
const { getRootProps, getInputProps } = useDropzone({ onDrop })
|
const { getRootProps, getInputProps } = useDropzone({ onDrop })
|
||||||
|
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { PageLink } from 'shared/components/page-link.mjs'
|
|
||||||
import { freeSewingConfig as conf } from 'shared/config/freesewing.config.mjs'
|
import { freeSewingConfig as conf } from 'shared/config/freesewing.config.mjs'
|
||||||
import {
|
import {
|
||||||
DesignIcon,
|
DesignIcon,
|
||||||
|
@ -44,14 +43,6 @@ import { ControlScore } from 'shared/components/control/score.mjs'
|
||||||
|
|
||||||
export const ns = ['account', 'i18n']
|
export const ns = ['account', 'i18n']
|
||||||
|
|
||||||
const actions = {
|
|
||||||
reload: 4,
|
|
||||||
export: 3,
|
|
||||||
restrict: 4,
|
|
||||||
disable: 4,
|
|
||||||
remove: 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
const itemIcons = {
|
const itemIcons = {
|
||||||
bookmarks: <BookmarkIcon />,
|
bookmarks: <BookmarkIcon />,
|
||||||
sets: <MeasieIcon />,
|
sets: <MeasieIcon />,
|
||||||
|
@ -121,9 +112,7 @@ export const AccountLinks = () => {
|
||||||
getUserData()
|
getUserData()
|
||||||
}, [account.id])
|
}, [account.id])
|
||||||
|
|
||||||
const lprops = { t, control: account.control }
|
|
||||||
const btnClasses = 'btn capitalize flex flex-row justify-between'
|
const btnClasses = 'btn capitalize flex flex-row justify-between'
|
||||||
const linkClasses = 'flex flex-row gap-2 text-lg py-2 items-center font-medium capitalize'
|
|
||||||
|
|
||||||
const itemPreviews = {
|
const itemPreviews = {
|
||||||
apikeys: apikeys?.length || 0,
|
apikeys: apikeys?.length || 0,
|
||||||
|
@ -166,7 +155,7 @@ export const AccountLinks = () => {
|
||||||
<div className="">
|
<div className="">
|
||||||
<h4 className="my-2">{t('data')}</h4>
|
<h4 className="my-2">{t('data')}</h4>
|
||||||
{Object.keys(conf.account.fields.data).map((item) => (
|
{Object.keys(conf.account.fields.data).map((item) => (
|
||||||
<AccountLink href={`/account/${item}`} title={t(item)}>
|
<AccountLink href={`/account/${item}`} title={t(item)} key={item}>
|
||||||
<div className="flex flex-row items-center gap-3 font-medium">
|
<div className="flex flex-row items-center gap-3 font-medium">
|
||||||
{itemIcons[item]}
|
{itemIcons[item]}
|
||||||
{t(`your${capitalize(item)}`)}
|
{t(`your${capitalize(item)}`)}
|
||||||
|
@ -179,7 +168,7 @@ export const AccountLinks = () => {
|
||||||
<div className="">
|
<div className="">
|
||||||
<h4 className="my-2">{t('info')}</h4>
|
<h4 className="my-2">{t('info')}</h4>
|
||||||
{Object.keys(conf.account.fields.info).map((item) => (
|
{Object.keys(conf.account.fields.info).map((item) => (
|
||||||
<AccountLink href={`/account/${item}`} title={t(item)}>
|
<AccountLink href={`/account/${item}`} title={t(item)} key={item}>
|
||||||
<div className="flex flex-row items-center gap-3 font-medium">
|
<div className="flex flex-row items-center gap-3 font-medium">
|
||||||
{itemIcons[item]}
|
{itemIcons[item]}
|
||||||
{t(item)}
|
{t(item)}
|
||||||
|
@ -199,7 +188,7 @@ export const AccountLinks = () => {
|
||||||
<div className="">
|
<div className="">
|
||||||
<h4 className="my-2">{t('settings')}</h4>
|
<h4 className="my-2">{t('settings')}</h4>
|
||||||
{Object.keys(conf.account.fields.settings).map((item) => (
|
{Object.keys(conf.account.fields.settings).map((item) => (
|
||||||
<AccountLink href={`/account/${item}`} title={t(item)}>
|
<AccountLink href={`/account/${item}`} title={t(item)} key={item}>
|
||||||
<div className="flex flex-row items-center gap-3 font-medium">
|
<div className="flex flex-row items-center gap-3 font-medium">
|
||||||
{itemIcons[item]}
|
{itemIcons[item]}
|
||||||
{t(item)}
|
{t(item)}
|
||||||
|
@ -212,7 +201,7 @@ export const AccountLinks = () => {
|
||||||
<div className="">
|
<div className="">
|
||||||
<h4 className="my-2">{t('linkedIdentities')}</h4>
|
<h4 className="my-2">{t('linkedIdentities')}</h4>
|
||||||
{Object.keys(conf.account.fields.identities).map((item) => (
|
{Object.keys(conf.account.fields.identities).map((item) => (
|
||||||
<AccountLink href={`/account/${item}`} title={t(item)}>
|
<AccountLink href={`/account/${item}`} title={t(item)} key={item}>
|
||||||
<div className="flex flex-row items-center gap-3 font-medium">
|
<div className="flex flex-row items-center gap-3 font-medium">
|
||||||
{itemIcons[item]}
|
{itemIcons[item]}
|
||||||
{t(item)}
|
{t(item)}
|
||||||
|
@ -225,7 +214,7 @@ export const AccountLinks = () => {
|
||||||
<div className="">
|
<div className="">
|
||||||
<h4 className="my-2">{t('security')}</h4>
|
<h4 className="my-2">{t('security')}</h4>
|
||||||
{Object.keys(conf.account.fields.security).map((item) => (
|
{Object.keys(conf.account.fields.security).map((item) => (
|
||||||
<AccountLink href={`/account/${item}`} title={t(item)}>
|
<AccountLink href={`/account/${item}`} title={t(item)} key={item}>
|
||||||
<div className="flex flex-row items-center gap-3 font-medium">
|
<div className="flex flex-row items-center gap-3 font-medium">
|
||||||
{itemIcons[item]}
|
{itemIcons[item]}
|
||||||
{t(item)}
|
{t(item)}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
|
|
|
@ -7,14 +7,13 @@ import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs'
|
||||||
// Components
|
// Components
|
||||||
import { BackToAccountButton } from './shared.mjs'
|
import { BackToAccountButton } from './shared.mjs'
|
||||||
import { Popout } from 'shared/components/popout/index.mjs'
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { WebLink } from 'shared/components/web-link.mjs'
|
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
export const RemoveAccount = () => {
|
export const RemoveAccount = () => {
|
||||||
// Hooks
|
// Hooks
|
||||||
const { setAccount, token, signOut } = useAccount()
|
const { signOut } = useAccount()
|
||||||
const backend = useBackend(token)
|
const backend = useBackend()
|
||||||
const { t } = useTranslation(ns)
|
const { t } = useTranslation(ns)
|
||||||
const { setLoadingStatus, LoadingStatus } = useLoadingStatus()
|
const { setLoadingStatus, LoadingStatus } = useLoadingStatus()
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,13 @@ import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs'
|
||||||
// Components
|
// Components
|
||||||
import { BackToAccountButton } from './shared.mjs'
|
import { BackToAccountButton } from './shared.mjs'
|
||||||
import { Popout } from 'shared/components/popout/index.mjs'
|
import { Popout } from 'shared/components/popout/index.mjs'
|
||||||
import { WebLink } from 'shared/components/web-link.mjs'
|
|
||||||
|
|
||||||
export const ns = ['account', 'status']
|
export const ns = ['account', 'status']
|
||||||
|
|
||||||
export const RestrictAccount = () => {
|
export const RestrictAccount = () => {
|
||||||
// Hooks
|
// Hooks
|
||||||
const { setAccount, token } = useAccount()
|
const { signOut } = useAccount()
|
||||||
const backend = useBackend(token)
|
const backend = useBackend()
|
||||||
const { t } = useTranslation(ns)
|
const { t } = useTranslation(ns)
|
||||||
const { setLoadingStatus, LoadingStatus } = useLoadingStatus()
|
const { setLoadingStatus, LoadingStatus } = useLoadingStatus()
|
||||||
|
|
||||||
|
@ -22,8 +21,10 @@ export const RestrictAccount = () => {
|
||||||
const restrictAccount = async () => {
|
const restrictAccount = async () => {
|
||||||
setLoadingStatus([true, 'processingUpdate'])
|
setLoadingStatus([true, 'processingUpdate'])
|
||||||
const result = await backend.restrictAccount()
|
const result = await backend.restrictAccount()
|
||||||
if (result.success) setLoadingStatus([true, 'nailedIt', true, true])
|
if (result.success) {
|
||||||
else setLoadingStatus([true, 'backendError', true, false])
|
setLoadingStatus([true, 'nailedIt', true, true])
|
||||||
|
signOut()
|
||||||
|
} else setLoadingStatus([true, 'backendError', true, false])
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { useState, useContext } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs'
|
import { useLoadingStatus } from 'shared/hooks/use-loading-status.mjs'
|
||||||
import { LoadingContext } from 'shared/context/loading-context.mjs'
|
|
||||||
// Components
|
// Components
|
||||||
import { Spinner } from 'shared/components/spinner.mjs'
|
|
||||||
import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
import { Icons, welcomeSteps, BackToAccountButton } from './shared.mjs'
|
||||||
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
import { OkIcon, NoIcon } from 'shared/components/icons.mjs'
|
||||||
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
import { ContinueButton } from 'shared/components/buttons/continue-button.mjs'
|
||||||
|
|
|
@ -6,7 +6,7 @@ export const ControlScore = ({ control, color = 'base-content' }) =>
|
||||||
control ? (
|
control ? (
|
||||||
<div className={`flex flex-row items-center text-${color}`}>
|
<div className={`flex flex-row items-center text-${color}`}>
|
||||||
{scores.map((score) => (
|
{scores.map((score) => (
|
||||||
<BulletIcon fill={control >= score ? true : false} className="w-6 h-6 -ml-1" />
|
<BulletIcon fill={control >= score ? true : false} className="w-6 h-6 -ml-1" key={score} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
) : null
|
) : null
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Hooks
|
// Hooks
|
||||||
import { useState, useEffect, useContext } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { useAccount } from 'shared/hooks/use-account.mjs'
|
import { useAccount } from 'shared/hooks/use-account.mjs'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
import { useBackend } from 'shared/hooks/use-backend.mjs'
|
||||||
|
@ -88,7 +88,6 @@ export const SignIn = () => {
|
||||||
? await backend.signIn({ username, password: false })
|
? await backend.signIn({ username, password: false })
|
||||||
: await backend.signIn({ username, password })
|
: await backend.signIn({ username, password })
|
||||||
// Sign-in succeeded
|
// Sign-in succeeded
|
||||||
console.log(result.response.response)
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
let msg
|
let msg
|
||||||
if (magicLink) {
|
if (magicLink) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue