File tree Expand file tree Collapse file tree
app/src/components/message
web/src/components/message Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { NotFoundError , ServerOfflineError } from '@concrnt/client'
22import { Text } from '@concrnt/ui'
33import { FallbackProps } from 'react-error-boundary'
4+ import { usePreference } from '../../contexts/Preference'
45
56export const RenderError = ( { error } : FallbackProps ) => {
7+ const [ devmode ] = usePreference ( 'developerMode' )
8+
69 if ( error instanceof NotFoundError ) {
710 return (
811 < div
@@ -43,6 +46,18 @@ export const RenderError = ({ error }: FallbackProps) => {
4346 )
4447 }
4548
49+ if ( ! devmode ) {
50+ return (
51+ < div
52+ style = { {
53+ padding : '0 8px'
54+ } }
55+ >
56+ < Text variant = "caption" > このメッセージは表示できません</ Text >
57+ </ div >
58+ )
59+ }
60+
4661 return (
4762 < div
4863 style = { {
Original file line number Diff line number Diff line change 11import { NotFoundError , ServerOfflineError } from '@concrnt/client'
22import { Text } from '@concrnt/ui'
33import { FallbackProps } from 'react-error-boundary'
4+ import { usePreference } from '../../contexts/Preference'
45
56export const RenderError = ( { error } : FallbackProps ) => {
7+ const [ devmode ] = usePreference ( 'developerMode' )
8+
69 if ( error instanceof NotFoundError ) {
710 return (
811 < div
@@ -44,6 +47,18 @@ export const RenderError = ({ error }: FallbackProps) => {
4447 )
4548 }
4649
50+ if ( ! devmode ) {
51+ return (
52+ < div
53+ style = { {
54+ padding : '0 8px'
55+ } }
56+ >
57+ < Text variant = "caption" > このメッセージは表示できません</ Text >
58+ </ div >
59+ )
60+ }
61+
4762 return (
4863 < div >
4964 { message }
You can’t perform that action at this time.
0 commit comments