Skip to content

Commit

Permalink
use named export
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Oct 28, 2024
1 parent ef6a261 commit fcab04d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useQuery, useApolloClient, gql } from '@apollo/client'

import { Select } from '../../../../../shared/Select.jsx'
import { StoreContext } from '../../../../../../storeContext.js'
import queryAdresses from './queryAdresses.js'
import { query } from './query.js'
import {
adresse as adresseFragment,
pop as popFragment,
Expand Down Expand Up @@ -78,11 +78,11 @@ const StatusLabel = styled(Label)`
grid-area: statusVal;
`

const Headdata = ({ pop, tpop, row }) => {
export const Headdata = observer(({ pop, tpop, row }) => {
const client = useApolloClient()
const store = useContext(StoreContext)
const { user, isPrint } = store
const { data, loading, error } = useQuery(queryAdresses)
const { data, loading, error } = useQuery(query)
const [errors, setErrors] = useState(null)

const saveToDb = useCallback(
Expand Down Expand Up @@ -199,6 +199,4 @@ const Headdata = ({ pop, tpop, row }) => {
<StatusLabel>{status}</StatusLabel>
</Container>
)
}

export default observer(Headdata)
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { gql } from '@apollo/client'

export default gql`
export const query = gql`
query TpopfreiwkontrAdressesQuery {
allAdresses(orderBy: NAME_ASC) {
nodes {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Projekte/Daten/Tpopfreiwkontr/Form/Title.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ const Container = styled(Area)`
}
`

const Title = ({ row }) => {
export const Title = ({ row }) => {
const year = row?.jahr ?? new Date().getFullYear()

return <Container>{`Erfolgskontrolle Artenschutz Flora ${year}`}</Container>
}

export default Title
4 changes: 2 additions & 2 deletions src/components/Projekte/Daten/Tpopfreiwkontr/Form/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { jwtDecode } from 'jwt-decode'
import { useQueryClient } from '@tanstack/react-query'

import { StringToCopyOnlyButton } from '../../../../shared/StringToCopyOnlyButton.jsx'
import Title from './Title.jsx'
import Headdata from './Headdata/index.jsx'
import { Title } from './Title.jsx'
import { Headdata } from './Headdata/index.jsx'
import Besttime from './Besttime.jsx'
import { DateField } from './Date.jsx'
import Map from './Map.jsx'
Expand Down

0 comments on commit fcab04d

Please sign in to comment.