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

1233: Implement lists as actual list #2521

Merged
merged 38 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
93ee4e7
1233: Implement lists as actual list
lunars97 Oct 12, 2023
7013b5f
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Oct 12, 2023
313a458
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Oct 15, 2023
ae5b866
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Oct 15, 2023
e5c0a92
1233: ts error
lunars97 Oct 15, 2023
e137dee
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Oct 15, 2023
86ac141
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Oct 23, 2023
6a5297f
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Oct 23, 2023
5d4a98f
1233: linting error is resolved
lunars97 Oct 23, 2023
ec05c37
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Oct 23, 2023
d0cf257
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Oct 30, 2023
25a7757
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Oct 30, 2023
d935507
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Oct 31, 2023
7e45d3d
1233: additional changes to accessibility
lunars97 Nov 2, 2023
5ffe465
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Nov 6, 2023
f5d2d5d
1233: improved accessibility on native and web
lunars97 Nov 6, 2023
974f403
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Nov 9, 2023
5b50ae7
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Nov 9, 2023
50a092e
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Nov 9, 2023
5651011
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Nov 9, 2023
03e4817
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Nov 9, 2023
45e82cb
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Nov 20, 2023
9ac544a
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Nov 20, 2023
773d118
1233: Removed some unnessary props and renamed the file
lunars97 Nov 20, 2023
1ea3fcb
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Nov 20, 2023
637f376
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Nov 24, 2023
f063368
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Nov 24, 2023
25da5fe
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Nov 24, 2023
e992d40
1233: implemented suggestion related to prop
lunars97 Nov 24, 2023
79dfbe9
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Dec 4, 2023
b2a2494
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Dec 4, 2023
c27de1e
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Dec 4, 2023
d7fbee8
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Dec 4, 2023
23ab06b
1233: added pluralization and implemented suggestions
lunars97 Dec 4, 2023
5a60629
Merge branch '1233-implement-lists-as-actual-lists' of github.com:dig…
lunars97 Dec 4, 2023
bcee709
1233: added translation and implemented suggestions
lunars97 Dec 5, 2023
b27482c
Merge branch 'main' of github.com:digitalfabrik/integreat-app into 12…
lunars97 Dec 5, 2023
fbd31a3
Merge branch 'main' into 1233-implement-lists-as-actual-lists
lunars97 Dec 6, 2023
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
6 changes: 5 additions & 1 deletion native/src/components/SearchListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { contentDirection } from '../constants/contentDirection'
import { PageResourceCacheStateType } from '../utils/DataContainer'
import { getCachedThumbnail } from './Categories'
import { CategoryThumbnail } from './CategoryListItem'
import List from './List'
import Pressable from './base/Pressable'

const FlexStyledLink = styled(Pressable)`
Expand Down Expand Up @@ -85,7 +86,8 @@ const SearchListItem = ({
}}
/>
)
return (

const SearchList = (
<FlexStyledLink onPress={() => onItemPress(category)}>
<DirectionContainer language={language}>
<SearchEntryContainer>
Expand All @@ -100,6 +102,8 @@ const SearchListItem = ({
</DirectionContainer>
</FlexStyledLink>
)

return <List items={category} renderItem={({ item: category }) => category} Header={SearchList} />
steffenkleinle marked this conversation as resolved.
Show resolved Hide resolved
}

export default memo(SearchListItem)
69 changes: 54 additions & 15 deletions native/src/routes/CityNotCooperating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import React, { ReactElement, useState } from 'react'
import { useTranslation } from 'react-i18next'
steffenkleinle marked this conversation as resolved.
Show resolved Hide resolved
import styled from 'styled-components/native'

import List from '../components/List'
import NothingFound from '../components/NothingFound'
import Icon from '../components/base/Icon'
import TextButton from '../components/base/TextButton'
import buildConfig, { buildConfigAssets } from '../constants/buildConfig'

const Container = styled.ScrollView`
const Container = styled.View`
display: flex;
padding: 30px;
flex: 1;
padding: 30px 30px 0 30px;
`

const Heading = styled.Text`
Expand All @@ -30,6 +33,7 @@ const ListHeading = styled(Heading)`
`

const ListItem = styled.View`
top: -130px;
flex-direction: row;
margin: 10px 0;
align-items: center;
Expand All @@ -53,30 +57,51 @@ const StepExplanation = styled.Text`
`

const StyledButton = styled(TextButton)`
top: -130px;
z-index: 1;
margin: 15px auto 0;
width: 70%;
`

const TemplateText = styled.Text`
top: -20px;
top: -150px;
border: 1px solid ${props => props.theme.colors.themeColor};
padding: 50px 30px 30px;
margin-bottom: 40px;
`

const StyledIcon = styled(Icon)`
margin: 10px 0;
align-self: center;
width: 50%;
height: 20%;
height: 30%;
`

type Step = {
number: string
id: string
explanation: string
}

const CityNotCooperating = (): ReactElement | null => {
const { t } = useTranslation('cityNotCooperating')
const [isCopied, setIsCopied] = useState<boolean>(false)
const template = buildConfig().featureFlags.cityNotCooperatingTemplate
const CityNotCooperatingIcon = buildConfigAssets().CityNotCooperatingIcon

const steps: Step[] = [
steffenkleinle marked this conversation as resolved.
Show resolved Hide resolved
{
id: '1',
number: '1',
explanation: 'findOutMail',
},
{
id: '2',
number: '2',
explanation: 'sendText',
},
]

if (!template) {
return null
}
Expand All @@ -86,24 +111,38 @@ const CityNotCooperating = (): ReactElement | null => {
setIsCopied(true)
}

return (
<Container>
<Heading>{t('callToAction')}</Heading>
const renderStepsList = ({ item }: { item: Step; index: number }) => (
<ListItem>
<StepNumber>{item.number}</StepNumber>
<StepExplanation>{t(item.explanation)}</StepExplanation>
</ListItem>
)

const CooperationHeader = (
<>
<Heading>{t('callToAction')}</Heading>
<Description>{t('explanation')}</Description>
{CityNotCooperatingIcon && <StyledIcon Icon={CityNotCooperatingIcon} />}
<ListHeading>{t('whatToDo')}</ListHeading>
<ListItem>
<StepNumber>1</StepNumber>
<StepExplanation>{t('findOutMail')}</StepExplanation>
</ListItem>
<ListItem>
<StepNumber>2</StepNumber>
<StepExplanation>{t('sendText')}</StepExplanation>
</ListItem>
</>
)

const CooperationFooter = (
<>
<StyledButton onPress={copyToClipboard} text={isCopied ? t('common:copied') : t('copyText')} />
<TemplateText>{template}</TemplateText>
</>
)

return (
<Container>
<List
items={steps}
renderItem={renderStepsList}
Header={CooperationHeader}
Footer={CooperationFooter}
noItemsMessage={<NothingFound />}
/>
</Container>
)
}
Expand Down