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

fix(native-app): minor fixes #16391

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion apps/native/app/src/messages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const en: TranslatedMessages = {
'home.onboardingModule.card2':
'The app’s purpose is to provide faster access to your documents, applications, and other dealings with governmental institutions.',
'home.onboardingModule.card3':
'If you have comments or suggestions about something that is missing or that could be improved, feel free to contact us via email at',
'If you have comments or suggestions about something that is missing or that could be improved, feel free to contact us via email at island@island.is',
'home.onboardingModule.card4':
'We encourage our users to read Digital Iceland’s privacy policy on',
'home.vehicleModule.summary':
Expand Down
2 changes: 1 addition & 1 deletion apps/native/app/src/messages/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const is = {
'home.onboardingModule.card2':
'Markmiðið með appinu er að þú hafir í hendi þér það sem þú þarfnast hverju sinni í samskiptum við hið opinbera.',
'home.onboardingModule.card3':
'Hafir þú athugasemdir eða ábendingar um eitthvað sem vantar eða sem má betur fara viljum við gjarnan fá frá þér línu á',
'Hafir þú athugasemdir eða ábendingar um eitthvað sem vantar eða sem má betur fara viljum við gjarnan fá frá þér línu á island@island.is',
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved
'home.onboardingModule.card4':
'Notendum er bent á að kynna sér stefnu Stafræns Íslands um meðferð persónuupplýsinga á',
'home.vehicleModule.summary':
Expand Down
6 changes: 4 additions & 2 deletions apps/native/app/src/screens/air-discount/air-discount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Typography,
} from '@ui'
import React from 'react'
import { SafeAreaView, ScrollView, View } from 'react-native'
import { Image, SafeAreaView, ScrollView, View } from 'react-native'
import { NavigationFunctionComponent } from 'react-native-navigation'
import { FormattedMessage, useIntl } from 'react-intl'
import styled, { useTheme } from 'styled-components/native'
Expand All @@ -22,6 +22,7 @@ import { AirDiscountCard } from '@ui/lib/card/air-discount-card'
import { Bullet } from '@ui/lib/bullet/bullet'
import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator'
import { AirfaresUsageTable } from './airfares-usage-table'
import externalLinkIcon from '../../assets/icons/external-link.png'

const BulletList = styled.View`
margin-vertical: 12px;
Expand Down Expand Up @@ -152,7 +153,8 @@ export const AirDiscountScreen: NavigationFunctionComponent = ({
<FormattedMessage
id="airDiscount.tosLinkText"
defaultMessage="Notendaskilmálar"
/>
/>{' '}
thoreyjona marked this conversation as resolved.
Show resolved Hide resolved
<Image source={externalLinkIcon} />
</LinkText>
</Link>
</TOSLink>
Expand Down
1 change: 0 additions & 1 deletion apps/native/app/src/screens/home/inbox-module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ const InboxModule = React.memo(({ data, loading, error }: InboxModuleProps) => {
publicationDate={item.publicationDate}
id={`${item.id}-${index}`}
unread={!item.opened}
bookmarked={item.bookmarked}
senderName={item.sender.name}
icon={
item.sender.name && getOrganizationLogoUrl(item.sender.name, 75)
Expand Down
1 change: 0 additions & 1 deletion apps/native/app/src/screens/home/onboarding-module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const OnboardingModule = React.memo(() => {
dark: '#150920',
light: theme.color.purple100,
}}
link={{ url: 'mailto:island@island.is', title: 'island@island.is' }}
/>
<WelcomeCard
key="card-4"
Expand Down
1 change: 0 additions & 1 deletion apps/native/app/src/screens/inbox/inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ const PressableListItem = React.memo(
publicationDate={item.publicationDate}
id={item.id}
unread={!item.opened}
bookmarked={item.bookmarked}
senderName={item.sender.name}
icon={item.sender.name && getOrganizationLogoUrl(item.sender.name, 75)}
isUrgent={item.isUrgent}
Expand Down
12 changes: 1 addition & 11 deletions apps/native/app/src/ui/lib/card/inbox-card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useEffect, useState } from 'react'
import React from 'react'
import { ImageSourcePropType } from 'react-native'
import { useTheme } from 'styled-components/native'
import { PressableHighlight } from '../../../components/pressable-highlight/pressable-highlight'
import { ListItem } from '../list/list-item'
import { toggleAction } from '../../../lib/post-mail-action'

interface InboxCardProps {
id: string
Expand All @@ -12,7 +11,6 @@ interface InboxCardProps {
subject: string
unread?: boolean
senderName?: string | null
bookmarked?: boolean | null
isUrgent?: boolean | null
testID?: string
onPress(id: string): void
Expand All @@ -25,13 +23,10 @@ export function InboxCard({
publicationDate,
icon,
unread,
bookmarked,
senderName,
isUrgent = false,
}: InboxCardProps) {
const theme = useTheme()
const [starred, setStarred] = useState<boolean>(false)
useEffect(() => setStarred(!!bookmarked), [bookmarked])
return (
<PressableHighlight
highlightColor={theme.shade.shade400}
Expand All @@ -42,11 +37,6 @@ export function InboxCard({
subtitle={subject}
date={publicationDate ? new Date(publicationDate) : undefined}
unread={unread}
starred={starred}
onStarPress={() => {
toggleAction(!bookmarked ? 'bookmark' : 'unbookmark', id)
setStarred(!bookmarked)
}}
urgent={!!isUrgent}
icon={icon}
/>
Expand Down
27 changes: 2 additions & 25 deletions apps/native/app/src/ui/lib/list/list-item.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Label, Typography } from '@ui'
import React, { isValidElement } from 'react'
import { FormattedDate, useIntl } from 'react-intl'
import { Image, ImageSourcePropType, Pressable } from 'react-native'
import styled, { useTheme } from 'styled-components/native'
import { Image, ImageSourcePropType } from 'react-native'
import styled from 'styled-components/native'

import StarFilled from '../../../assets/icons/star-filled.png'
import Star from '../../../assets/icons/star.png'
import { dynamicColor } from '../../utils'

const Host = styled.SafeAreaView<{ unread?: boolean }>`
Expand Down Expand Up @@ -61,16 +59,6 @@ const Title = styled.View`

const Cell = styled.View``

const StarImage = styled.Image<{ active?: boolean }>`
tint-color: ${dynamicColor(({ active, theme }) => ({
dark: active ? theme.color.blue400 : theme.color.dark300,
light: active ? theme.color.blue400 : theme.color.dark300,
}))};
width: 16px;
height: 16px;
margin-top: -4px;
`

interface ListItemAction {
id: string
text: string
Expand All @@ -84,8 +72,6 @@ interface ListItemProps {
unread?: boolean
actions?: ListItemAction[]
icon?: ImageSourcePropType | React.ReactNode
onStarPress?(): void
starred?: boolean
urgent?: boolean
}

Expand All @@ -94,13 +80,10 @@ export function ListItem({
subtitle,
date,
icon,
onStarPress,
starred = false,
unread = false,
urgent = false,
}: ListItemProps) {
const intl = useIntl()
const theme = useTheme()
return (
<Cell>
<Host unread={unread}>
Expand Down Expand Up @@ -144,12 +127,6 @@ export function ListItem({
{intl.formatMessage({ id: 'inbox.urgent' })}
</Label>
)}
<Pressable hitSlop={16} onPress={onStarPress}>
<StarImage
source={starred ? StarFilled : Star}
active={starred}
/>
</Pressable>
</Row>
</Content>
</Host>
Expand Down