diff --git a/.prettierrc.json b/.prettierrc.json
index ad53c05..368bebf 100644
--- a/.prettierrc.json
+++ b/.prettierrc.json
@@ -1,6 +1,7 @@
{
- "arrowParens": "avoid",
- "semi": false,
- "singleQuote": true,
- "tabWidth": 2
+ "arrowParens": "avoid",
+ "semi": false,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "es5"
}
diff --git a/src/Ticker.test.tsx b/src/Ticker.test.tsx
index d670525..e7f45b4 100644
--- a/src/Ticker.test.tsx
+++ b/src/Ticker.test.tsx
@@ -6,21 +6,21 @@ import { TickerProvider } from './components/useTicker'
describe('Ticker', function () {
const initSettings = {
- refresh_interval: 1000,
- inactive_settings: {
+ refreshInterval: 1000,
+ inactiveSettings: {
author: 'Systemli Ticker Team',
email: 'admin@systemli.org',
homepage: '',
twitter: '',
headline: 'The ticker is currently inactive.',
- sub_headline: 'Please contact us if you want to use it.',
+ subHeadline: 'Please contact us if you want to use it.',
description: '...',
},
} as Settings
const ticker = {
id: '1',
active: true,
- creation_date: new Date(),
+ createdAt: new Date(),
title: 'Ticker Title',
description: 'Ticker Description',
domain: 'example.com',
diff --git a/src/Ticker.tsx b/src/Ticker.tsx
index b3c0ef0..b4ba31e 100644
--- a/src/Ticker.tsx
+++ b/src/Ticker.tsx
@@ -38,8 +38,8 @@ const Ticker: FC = () => {
return
}
- if (ticker === null && settings?.inactive_settings !== undefined) {
- return
+ if (ticker === null && settings?.inactiveSettings !== undefined) {
+ return
}
return
...
diff --git a/src/components/Attachments.test.tsx b/src/components/Attachments.test.tsx
index b3fad6d..f019db6 100644
--- a/src/components/Attachments.test.tsx
+++ b/src/components/Attachments.test.tsx
@@ -4,7 +4,7 @@ import Attachments from './Attachments'
describe('Attachment', function () {
test('renders single image correctly', function () {
const attachments = [
- { content_type: 'image/jpeg', url: 'https://example.com/image.jpg' },
+ { contentType: 'image/jpeg', url: 'https://example.com/image.jpg' },
]
const { asFragment } = render()
@@ -13,8 +13,8 @@ describe('Attachment', function () {
test('renders multiple images as slider', function () {
const attachments = [
- { content_type: 'image/jpeg', url: 'https://example.com/image.jpg' },
- { content_type: 'image/jpeg', url: 'https://example.com/image.jpg' },
+ { contentType: 'image/jpeg', url: 'https://example.com/image.jpg' },
+ { contentType: 'image/jpeg', url: 'https://example.com/image.jpg' },
]
const { asFragment } = render()
diff --git a/src/components/Message.test.tsx b/src/components/Message.test.tsx
index 8ded2b2..6868291 100644
--- a/src/components/Message.test.tsx
+++ b/src/components/Message.test.tsx
@@ -7,11 +7,9 @@ describe('Message', function () {
id: '1',
text: 'message',
ticker: 1,
- creation_date: new Date(),
- tweet_id: '',
- tweet_user: '',
+ createdAt: new Date(),
attachments: [],
- geo_information: '{"type":"FeatureCollection","features":[]}',
+ geoInformation: '{"type":"FeatureCollection","features":[]}',
}
const { asFragment } = render()
@@ -25,11 +23,9 @@ describe('Message', function () {
id: '1',
text: 'message',
ticker: 1,
- creation_date: new Date(),
- tweet_id: '',
- tweet_user: '',
+ createdAt: new Date(),
attachments: [],
- geo_information:
+ geoInformation:
'{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[13.466282,52.5024]},"properties":null}]}',
}
const { asFragment } = render()
diff --git a/src/components/Message.tsx b/src/components/Message.tsx
index 337601f..90eda68 100644
--- a/src/components/Message.tsx
+++ b/src/components/Message.tsx
@@ -24,10 +24,10 @@ const Message: FC = props => {
const relativeCreationDate = (
- {dayjs(props.message.creation_date).fromNow()}
+ {dayjs(props.message.createdAt).fromNow()}
)
- const creationDate = dayjs(props.message.creation_date).format('LLLL')
+ const creationDate = dayjs(props.message.createdAt).format('LLLL')
return (
@@ -43,7 +43,7 @@ const Message: FC = props => {
)}
-
+
diff --git a/src/components/MessageList.tsx b/src/components/MessageList.tsx
index f7af77b..0b978ae 100644
--- a/src/components/MessageList.tsx
+++ b/src/components/MessageList.tsx
@@ -99,11 +99,11 @@ const MessageList: FC = () => {
useEffect(() => {
const interval = setInterval(
() => fetchMessages(),
- settings?.refresh_interval || 60000
+ settings?.refreshInterval || 60000
)
return () => clearInterval(interval)
- }, [fetchMessages, messages, settings?.refresh_interval])
+ }, [fetchMessages, messages, settings?.refreshInterval])
const renderPlaceholder = () => (
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 4518e3b..e310c4a 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -1,6 +1,6 @@
export type Ticker = {
active: boolean
- creation_date: Date
+ createdAt: Date
description: string
domain: string
id: string
@@ -18,8 +18,8 @@ type TickerInformation = {
}
export type Settings = {
- refresh_interval: number
- inactive_settings: InactiveSettings
+ refreshInterval: number
+ inactiveSettings: InactiveSettings
}
export type InactiveSettings = {
@@ -28,7 +28,7 @@ export type InactiveSettings = {
homepage: string
twitter: string
headline: string
- sub_headline: string
+ subHeadline: string
description: string
}
@@ -45,16 +45,14 @@ export type Message = {
id: string
text: string
ticker: number
- creation_date: Date
- tweet_id: string
- tweet_user: string
+ createdAt: Date
attachments: Attachment[]
// Stringified GeoJSON.FeatureCollection
- geo_information: string
+ geoInformation: string
}
export type Attachment = {
// FIXME: Enum?
- content_type: string
+ contentType: string
url: string
}
diff --git a/src/views/InactiveView.tsx b/src/views/InactiveView.tsx
index bb082b7..f58ad97 100644
--- a/src/views/InactiveView.tsx
+++ b/src/views/InactiveView.tsx
@@ -20,7 +20,7 @@ const InactiveView: FC = props => {
{props.settings.headline}
- {props.settings.sub_headline}
+ {props.settings.subHeadline}
)
@@ -30,7 +30,7 @@ const InactiveView: FC = props => {
{props.settings.headline &&
- props.settings.sub_headline &&
+ props.settings.subHeadline &&
renderHeader()}