Eslint updates

This commit is contained in:
Bill 2022-04-03 20:52:34 -04:00
parent fd77cf7bf0
commit 6a65398cc6
128 changed files with 459 additions and 462 deletions

View File

@ -1,4 +1,5 @@
{
"root": true,
"settings": {
"react": {
"pragma": "React",
@ -32,8 +33,13 @@
"@typescript-eslint/indent": [ "error", 4, { "SwitchCase": 1 } ],
"array-bracket-spacing": [ "error", "always" ],
"brace-style": [ "error", "allman" ],
"template-curly-spacing": [ "error", "always" ],
"no-multi-spaces": [ "error" ],
"react/prop-types": [ "off" ],
"object-curly-spacing": [ "error", "always" ],
"jsx-quotes": [ "error" ],
"react/jsx-curly-spacing": [ "error", "always" ],
"react/jsx-equals-spacing": [ "error" ],
"@typescript-eslint/object-curly-spacing": [ "error", "always", { "arraysInObjects": true, "objectsInObjects": false } ],
"@typescript-eslint/ban-types": [
"error",
{

View File

@ -30,5 +30,5 @@ export const LayoutFurniIconImageView: FC<LayoutFurniIconImageViewProps> = props
return imageUrl;
}
return <LayoutImage imageUrl={ getImageIconUrl() } className='furni-image' { ...rest } />;
return <LayoutImage imageUrl={ getImageIconUrl() } className="furni-image" { ...rest } />;
}

View File

@ -57,7 +57,7 @@ export const FriendsMessengerThreadGroup: FC<{ thread: MessengerThread, group: M
<LayoutAvatarImageView figure={ groupChatData.figure } direction={ 2 } /> }
</Base>
<Base className={ 'bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-' + (isOwnChat ? 'right' : 'left') }>
<Base className='fw-bold'>
<Base className="fw-bold">
{ isOwnChat && GetSessionDataManager().userName }
{ !isOwnChat && (groupChatData ? groupChatData.username : thread.participant.name) }
</Base>

View File

@ -3,19 +3,11 @@ import { FC, useCallback, useEffect, useState } from 'react';
import { LocalizeText, NotificationUtilities, SendMessageComposer } from '../../../../../api';
import { UseMessageEventHook } from '../../../../../hooks';
export interface PromoArticleWidgetViewProps
{}
export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
export const PromoArticleWidgetView: FC<{}> = props =>
{
const [ articles, setArticles ] = useState<PromoArticleData[]>(null);
const [ index, setIndex ] = useState(0);
const handleSelect = (selectedIndex) =>
{
setIndex(selectedIndex);
};
const onPromoArticlesMessageEvent = useCallback((event: PromoArticlesMessageEvent) =>
{
const parser = event.getParser();
@ -39,7 +31,7 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
</div>
<div className="d-flex flex-row mb-1">
{articles && (articles.length > 0) && articles.map((article, ind) =>
<div className={'promo-articles-bullet cursor-pointer ' + (article === articles[index] ? 'promo-articles-bullet-active' : '')} key={article.id} onClick={event => handleSelect(ind)} />
<div className={ 'promo-articles-bullet cursor-pointer ' + (article === articles[index] ? 'promo-articles-bullet-active' : '') } key={ article.id } onClick={ event => setIndex(ind) } />
)}
</div>
{articles && articles[index] &&
@ -50,8 +42,7 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
<b>{ articles[index].bodyText }</b>
<button className="btn btn-sm mt-auto btn-gainsboro" onClick={ event => NotificationUtilities.openUrl(articles[index].linkContent) }>{ articles[index].buttonText }</button>
</div>
</div>
}
</div> }
</div>
);
}

View File

@ -225,7 +225,7 @@ export const NavigatorView: FC<{}> = props =>
<FontAwesomeIcon icon="plus" />
</NitroCardTabsItemView>
</NitroCardTabsView>
<NitroCardContentView position='relative'>
<NitroCardContentView position="relative">
{ isLoading &&
<Base fit position="absolute" className="top-0 start-0 z-index-1 bg-muted opacity-0-5" /> }
{ !isCreatorOpen &&

View File

@ -91,7 +91,7 @@ export const NavigatorSearchResultItemView: FC<NavigatorSearchResultItemViewProp
{ (roomData.doorMode !== RoomDataParser.OPEN_STATE) &&
<i className={ ('position-absolute end-0 mb-1 me-1 icon icon-navigator-room-' + ((roomData.doorMode === RoomDataParser.DOORBELL_STATE) ? 'locked' : (roomData.doorMode === RoomDataParser.PASSWORD_STATE) ? 'password' : (roomData.doorMode === RoomDataParser.INVISIBLE_STATE) ? 'invisible' : '')) } /> }
</LayoutRoomThumbnailView>
<Flex className='w-100'>
<Flex className="w-100">
<Text truncate className="flex-grow-1">{roomData.roomName}</Text>
<Flex reverse alignItems="center" gap={ 1 }>
<NavigatorSearchResultItemInfoView roomData={ roomData } />

View File

@ -61,7 +61,7 @@ export const NavigatorSearchResultView: FC<NavigatorSearchResultViewProps> = pro
{
gridHasTwoColumns ? <AutoGrid columnCount={ 3 } { ...rest } columnMinWidth={ 110 } columnMinHeight={ 130 } className="mx-2">
{searchResult.rooms.length > 0 && searchResult.rooms.map((room, index) => <NavigatorSearchResultItemView key={ index } roomData={ room } thumbnail={ true } />) }
</AutoGrid> : <Grid columnCount={ 1 } className='navigator-grid' gap={ 0 }>
</AutoGrid> : <Grid columnCount={ 1 } className="navigator-grid" gap={ 0 }>
{ searchResult.rooms.length > 0 && searchResult.rooms.map((room, index) => <NavigatorSearchResultItemView key={ index } roomData={ room } />) }
</Grid>
}