Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Property for Bluesky Profile URL #566

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/Ticker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
facebook: string
telegram: string
mastodon: string
bluesky: string
}

export interface TickerTelegram {
Expand Down Expand Up @@ -78,7 +79,7 @@
'Content-Type': 'application/json',
}

const deleteTicker = (ticker: Ticker): Promise<Response<any>> => {

Check warning on line 82 in src/api/Ticker.ts

View workflow job for this annotation

GitHub Actions / ESLint Results

src/api/Ticker.ts#L82

Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
return fetch(`${ApiUrl}/admin/tickers/${ticker.id}`, {
headers: headers,
method: 'delete',
Expand All @@ -91,7 +92,7 @@
}).then(response => response.json())
}

const deleteTickerUser = (ticker: Ticker, user: User): Promise<Response<any>> => {

Check warning on line 95 in src/api/Ticker.ts

View workflow job for this annotation

GitHub Actions / ESLint Results

src/api/Ticker.ts#L95

Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
return fetch(`${ApiUrl}/admin/tickers/${ticker.id}/users/${user.id}`, {
headers: headers,
method: 'delete',
Expand All @@ -106,7 +107,7 @@
return fetch(`${ApiUrl}/admin/tickers/${id}`, { headers: headers }).then(response => response.json())
}

const postTicker = (data: any): Promise<Response<TickerResponseData>> => {

Check warning on line 110 in src/api/Ticker.ts

View workflow job for this annotation

GitHub Actions / ESLint Results

src/api/Ticker.ts#L110

Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
return fetch(`${ApiUrl}/admin/tickers`, {
headers: headers,
body: JSON.stringify(data),
Expand All @@ -114,7 +115,7 @@
}).then(response => response.json())
}

const putTicker = (data: any, id: number): Promise<Response<TickerResponseData>> => {

Check warning on line 118 in src/api/Ticker.ts

View workflow job for this annotation

GitHub Actions / ESLint Results

src/api/Ticker.ts#L118

Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any)
return fetch(`${ApiUrl}/admin/tickers/${id}`, {
headers: headers,
body: JSON.stringify(data),
Expand Down
20 changes: 19 additions & 1 deletion src/components/ticker/TickerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LocationSearch, { Result } from './LocationSearch'
import { MapContainer, Marker, TileLayer } from 'react-leaflet'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Alert, Button, Checkbox, FormControlLabel, FormGroup, Grid, InputAdornment, Stack, TextField, Typography } from '@mui/material'
import { faComputerMouse, faEnvelope, faUser } from '@fortawesome/free-solid-svg-icons'
import { faComputerMouse, faEnvelope, faSquare, faUser } from '@fortawesome/free-solid-svg-icons'
import { faFacebook, faMastodon, faTelegram, faTwitter } from '@fortawesome/free-brands-svg-icons'

interface Props {
Expand All @@ -29,6 +29,7 @@ interface FormValues {
facebook: string
telegram: string
mastodon: string
bluesky: string
}
location: {
lat: number
Expand All @@ -51,6 +52,7 @@ const TickerForm: FC<Props> = ({ callback, id, ticker }) => {
facebook: ticker?.information.facebook,
telegram: ticker?.information.telegram,
mastodon: ticker?.information.mastodon,
bluesky: ticker?.information.bluesky,
},
location: {
lat: ticker?.location.lat || 0,
Expand Down Expand Up @@ -242,6 +244,22 @@ const TickerForm: FC<Props> = ({ callback, id, ticker }) => {
/>
</FormGroup>
</Grid>
<Grid item sm={6} xs={12}>
<FormGroup>
<TextField
{...register('information.bluesky')}
InputProps={{
startAdornment: (
<InputAdornment position="start">
<FontAwesomeIcon icon={faSquare} />
</InputAdornment>
),
}}
label="Bluesky"
margin="dense"
/>
</FormGroup>
</Grid>
<Grid item xs={12}>
<Typography component="h6" variant="h6">
Location
Expand Down
Loading