1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-20 02:00:49 +00:00

Fix type imports in frontend

This commit is contained in:
Ash Keel 2021-10-28 11:00:01 +02:00
parent d5fa102a8e
commit b3062a04f9
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E
9 changed files with 18 additions and 17 deletions

View file

@ -7,10 +7,9 @@ import {
} from '@strimertul/kilovolt-client'; } from '@strimertul/kilovolt-client';
import { RootState } from '../store'; import { RootState } from '../store';
import apiReducer, { import apiReducer, {
APIState,
getUserPoints, getUserPoints,
LoyaltyStorage,
} from '../store/api/reducer'; } from '../store/api/reducer';
import {APIState, LoyaltyStorage} from "../store/api/types";
export function useModule<T>({ export function useModule<T>({
key, key,

View file

@ -144,7 +144,6 @@ label {
} }
.tabs.is-boxed li a.is-active { .tabs.is-boxed li a.is-active {
border-color: #5e6d6f; border-color: #5e6d6f;
border-bottom-color: rgb(94, 109, 111);
border-bottom-color: transparent !important; border-bottom-color: transparent !important;
} }
.tabs li a.is-active { .tabs li a.is-active {

View file

@ -35,7 +35,7 @@ function Modal({
<div <div
className="modal-background" className="modal-background"
onClick={bgDismiss ? () => onClose() : null} onClick={bgDismiss ? () => onClose() : null}
></div> />
<div className="modal-card"> <div className="modal-card">
<header className="modal-card-head"> <header className="modal-card-head">
<p className="modal-card-title">{title}</p> <p className="modal-card-title">{title}</p>
@ -44,7 +44,7 @@ function Modal({
className="delete" className="delete"
aria-label="close" aria-label="close"
onClick={() => onClose()} onClick={() => onClose()}
></button> />
) : null} ) : null}
</header> </header>
<section className="modal-card-body">{children}</section> <section className="modal-card-body">{children}</section>

View file

@ -4,8 +4,9 @@ import { useTranslation } from 'react-i18next';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { useModule } from '../../../lib/react-utils'; import { useModule } from '../../../lib/react-utils';
import { RootState } from '../../../store'; import { RootState } from '../../../store';
import { LoyaltyGoal, modules } from '../../../store/api/reducer'; import { modules } from '../../../store/api/reducer';
import Modal from '../../components/Modal'; import Modal from '../../components/Modal';
import {LoyaltyGoal} from "../../../store/api/types";
interface GoalItemProps { interface GoalItemProps {
item: LoyaltyGoal; item: LoyaltyGoal;
@ -252,7 +253,7 @@ function GoalModal({
placeholder={t('loyalty.goals.description-placeholder')} placeholder={t('loyalty.goals.description-placeholder')}
onChange={(ev) => setDescription(ev.target.value)} onChange={(ev) => setDescription(ev.target.value)}
value={description} value={description}
></textarea> />
</p> </p>
</div> </div>
</div> </div>

View file

@ -4,12 +4,12 @@ import { RouteComponentProps } from '@reach/router';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useModule, useUserPoints } from '../../../lib/react-utils'; import { useModule, useUserPoints } from '../../../lib/react-utils';
import { import {
LoyaltyRedeem,
modules, modules,
removeRedeem, removeRedeem,
setUserPoints, setUserPoints,
} from '../../../store/api/reducer'; } from '../../../store/api/reducer';
import PageList from '../../components/PageList'; import PageList from '../../components/PageList';
import {LoyaltyRedeem} from "../../../store/api/types";
interface SortingOrder { interface SortingOrder {
key: 'user' | 'when'; key: 'user' | 'when';
@ -154,7 +154,7 @@ export default function LoyaltyRedeemQueuePage(
</th> </th>
<th>{t('loyalty.queue.reward-name')}</th> <th>{t('loyalty.queue.reward-name')}</th>
<th>{t('loyalty.queue.request')}</th> <th>{t('loyalty.queue.request')}</th>
<th></th> <th />
</tr> </tr>
</thead> </thead>

View file

@ -7,11 +7,11 @@ import { useModule } from '../../../lib/react-utils';
import { RootState } from '../../../store'; import { RootState } from '../../../store';
import { import {
createRedeem, createRedeem,
LoyaltyReward,
modules, modules,
} from '../../../store/api/reducer'; } from '../../../store/api/reducer';
import Modal from '../../components/Modal'; import Modal from '../../components/Modal';
import { getInterval } from '../../../lib/time-utils'; import { getInterval } from '../../../lib/time-utils';
import {LoyaltyReward} from "../../../store/api/types";
interface RewardItemProps { interface RewardItemProps {
item: LoyaltyReward; item: LoyaltyReward;
@ -262,7 +262,7 @@ function RewardModal({
placeholder={t('loyalty.rewards.description-placeholder')} placeholder={t('loyalty.rewards.description-placeholder')}
onChange={(ev) => setDescription(ev.target.value)} onChange={(ev) => setDescription(ev.target.value)}
value={description} value={description}
></textarea> />
</p> </p>
</div> </div>
</div> </div>
@ -289,7 +289,7 @@ function RewardModal({
</div> </div>
</div> </div>
<div className="field is-horizontal"> <div className="field is-horizontal">
<div className="field-label is-normal"></div> <div className="field-label is-normal" />
<div className="field-body"> <div className="field-body">
<div className="field"> <div className="field">
<label className="checkbox"> <label className="checkbox">

View file

@ -6,11 +6,11 @@ import PageList from '../../components/PageList';
import { useModule, useUserPoints } from '../../../lib/react-utils'; import { useModule, useUserPoints } from '../../../lib/react-utils';
import { RootState } from '../../../store'; import { RootState } from '../../../store';
import { import {
LoyaltyPointsEntry,
modules, modules,
setUserPoints, setUserPoints,
} from '../../../store/api/reducer'; } from '../../../store/api/reducer';
import Modal from '../../components/Modal'; import Modal from '../../components/Modal';
import {LoyaltyPointsEntry} from "../../../store/api/types";
interface UserData { interface UserData {
user: string; user: string;
@ -266,7 +266,7 @@ export default function LoyaltyUserListPage(
) : null} ) : null}
</span> </span>
</th> </th>
<th style={{ width: '10%' }}></th> <th style={{ width: '10%' }} />
</tr> </tr>
</thead> </thead>

View file

@ -147,6 +147,7 @@ export default function StulbeWebhooksPage(
<img <img
style={{ width: '20px', borderRadius: '5px' }} style={{ width: '20px', borderRadius: '5px' }}
src={userStatus.profile_image_url} src={userStatus.profile_image_url}
alt="Profile picture"
/> />
<b>{userStatus.display_name}</b> <b>{userStatus.display_name}</b>
</div> </div>

View file

@ -3,8 +3,9 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { useModule } from '../../../lib/react-utils'; import { useModule } from '../../../lib/react-utils';
import { modules, TwitchBotCustomCommand } from '../../../store/api/reducer'; import { modules } from '../../../store/api/reducer';
import Modal from '../../components/Modal'; import Modal from '../../components/Modal';
import {TwitchBotCustomCommand} from "../../../store/api/types";
interface CommandItemProps { interface CommandItemProps {
name: string; name: string;
@ -151,7 +152,7 @@ function CommandModal({
rows={1} rows={1}
onChange={(ev) => setDescription(ev.target.value)} onChange={(ev) => setDescription(ev.target.value)}
value={description} value={description}
></textarea> />
</p> </p>
</div> </div>
</div> </div>
@ -168,7 +169,7 @@ function CommandModal({
placeholder={t('twitch.commands.response-help')} placeholder={t('twitch.commands.response-help')}
onChange={(ev) => setResponse(ev.target.value)} onChange={(ev) => setResponse(ev.target.value)}
value={response} value={response}
></textarea> />
</p> </p>
</div> </div>
</div> </div>