mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-18 09:52:37 +01:00
Eslint updates
This commit is contained in:
parent
fd77cf7bf0
commit
6a65398cc6
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"root": true,
|
||||||
"settings": {
|
"settings": {
|
||||||
"react": {
|
"react": {
|
||||||
"pragma": "React",
|
"pragma": "React",
|
||||||
@ -32,8 +33,13 @@
|
|||||||
"@typescript-eslint/indent": [ "error", 4, { "SwitchCase": 1 } ],
|
"@typescript-eslint/indent": [ "error", 4, { "SwitchCase": 1 } ],
|
||||||
"array-bracket-spacing": [ "error", "always" ],
|
"array-bracket-spacing": [ "error", "always" ],
|
||||||
"brace-style": [ "error", "allman" ],
|
"brace-style": [ "error", "allman" ],
|
||||||
|
"template-curly-spacing": [ "error", "always" ],
|
||||||
|
"no-multi-spaces": [ "error" ],
|
||||||
"react/prop-types": [ "off" ],
|
"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": [
|
"@typescript-eslint/ban-types": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
@ -30,5 +30,5 @@ export const LayoutFurniIconImageView: FC<LayoutFurniIconImageViewProps> = props
|
|||||||
return imageUrl;
|
return imageUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <LayoutImage imageUrl={ getImageIconUrl() } className='furni-image' { ...rest } />;
|
return <LayoutImage imageUrl={ getImageIconUrl() } className="furni-image" { ...rest } />;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ export const FriendsMessengerThreadGroup: FC<{ thread: MessengerThread, group: M
|
|||||||
<LayoutAvatarImageView figure={ groupChatData.figure } direction={ 2 } /> }
|
<LayoutAvatarImageView figure={ groupChatData.figure } direction={ 2 } /> }
|
||||||
</Base>
|
</Base>
|
||||||
<Base className={ 'bg-light text-black border-radius mb-2 rounded py-1 px-2 messages-group-' + (isOwnChat ? 'right' : 'left') }>
|
<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 && GetSessionDataManager().userName }
|
||||||
{ !isOwnChat && (groupChatData ? groupChatData.username : thread.participant.name) }
|
{ !isOwnChat && (groupChatData ? groupChatData.username : thread.participant.name) }
|
||||||
</Base>
|
</Base>
|
||||||
|
@ -3,19 +3,11 @@ import { FC, useCallback, useEffect, useState } from 'react';
|
|||||||
import { LocalizeText, NotificationUtilities, SendMessageComposer } from '../../../../../api';
|
import { LocalizeText, NotificationUtilities, SendMessageComposer } from '../../../../../api';
|
||||||
import { UseMessageEventHook } from '../../../../../hooks';
|
import { UseMessageEventHook } from '../../../../../hooks';
|
||||||
|
|
||||||
export interface PromoArticleWidgetViewProps
|
export const PromoArticleWidgetView: FC<{}> = props =>
|
||||||
{}
|
|
||||||
|
|
||||||
export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
|
|
||||||
{
|
{
|
||||||
const [ articles, setArticles ] = useState<PromoArticleData[]>(null);
|
const [ articles, setArticles ] = useState<PromoArticleData[]>(null);
|
||||||
const [ index, setIndex ] = useState(0);
|
const [ index, setIndex ] = useState(0);
|
||||||
|
|
||||||
const handleSelect = (selectedIndex) =>
|
|
||||||
{
|
|
||||||
setIndex(selectedIndex);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onPromoArticlesMessageEvent = useCallback((event: PromoArticlesMessageEvent) =>
|
const onPromoArticlesMessageEvent = useCallback((event: PromoArticlesMessageEvent) =>
|
||||||
{
|
{
|
||||||
const parser = event.getParser();
|
const parser = event.getParser();
|
||||||
@ -39,7 +31,7 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
|
|||||||
</div>
|
</div>
|
||||||
<div className="d-flex flex-row mb-1">
|
<div className="d-flex flex-row mb-1">
|
||||||
{articles && (articles.length > 0) && articles.map((article, ind) =>
|
{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>
|
</div>
|
||||||
{articles && articles[index] &&
|
{articles && articles[index] &&
|
||||||
@ -50,8 +42,7 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
|
|||||||
<b>{ articles[index].bodyText }</b>
|
<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>
|
<button className="btn btn-sm mt-auto btn-gainsboro" onClick={ event => NotificationUtilities.openUrl(articles[index].linkContent) }>{ articles[index].buttonText }</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> }
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ export const NavigatorView: FC<{}> = props =>
|
|||||||
<FontAwesomeIcon icon="plus" />
|
<FontAwesomeIcon icon="plus" />
|
||||||
</NitroCardTabsItemView>
|
</NitroCardTabsItemView>
|
||||||
</NitroCardTabsView>
|
</NitroCardTabsView>
|
||||||
<NitroCardContentView position='relative'>
|
<NitroCardContentView position="relative">
|
||||||
{ isLoading &&
|
{ isLoading &&
|
||||||
<Base fit position="absolute" className="top-0 start-0 z-index-1 bg-muted opacity-0-5" /> }
|
<Base fit position="absolute" className="top-0 start-0 z-index-1 bg-muted opacity-0-5" /> }
|
||||||
{ !isCreatorOpen &&
|
{ !isCreatorOpen &&
|
||||||
|
@ -91,7 +91,7 @@ export const NavigatorSearchResultItemView: FC<NavigatorSearchResultItemViewProp
|
|||||||
{ (roomData.doorMode !== RoomDataParser.OPEN_STATE) &&
|
{ (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' : '')) } /> }
|
<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>
|
</LayoutRoomThumbnailView>
|
||||||
<Flex className='w-100'>
|
<Flex className="w-100">
|
||||||
<Text truncate className="flex-grow-1">{roomData.roomName}</Text>
|
<Text truncate className="flex-grow-1">{roomData.roomName}</Text>
|
||||||
<Flex reverse alignItems="center" gap={ 1 }>
|
<Flex reverse alignItems="center" gap={ 1 }>
|
||||||
<NavigatorSearchResultItemInfoView roomData={ roomData } />
|
<NavigatorSearchResultItemInfoView roomData={ roomData } />
|
||||||
|
@ -61,7 +61,7 @@ export const NavigatorSearchResultView: FC<NavigatorSearchResultViewProps> = pro
|
|||||||
{
|
{
|
||||||
gridHasTwoColumns ? <AutoGrid columnCount={ 3 } { ...rest } columnMinWidth={ 110 } columnMinHeight={ 130 } className="mx-2">
|
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 } />) }
|
{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 } />) }
|
{ searchResult.rooms.length > 0 && searchResult.rooms.map((room, index) => <NavigatorSearchResultItemView key={ index } roomData={ room } />) }
|
||||||
</Grid>
|
</Grid>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user