Skip to content

Commit

Permalink
Merge branch 'main' into chore/inao-cem-income-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 12, 2024
2 parents da567fa + 992ef02 commit 3ba2741
Show file tree
Hide file tree
Showing 71 changed files with 884 additions and 433 deletions.
6 changes: 3 additions & 3 deletions apps/native/app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ react {
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
reactNativeDir = file("../../../../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
codegenDir = file("../../../../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
cliFile = file("../../../../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down
4 changes: 2 additions & 2 deletions apps/native/app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
url("$rootDir/../../../../../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
url("$rootDir/../../../../../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
Expand Down
5 changes: 1 addition & 4 deletions apps/native/app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ applyNativeModulesSettingsGradle(settings)
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../../../../node_modules/react-native-code-push/android/app')

include ':react-native-clipboard'
project(':react-native-clipboard').projectDir = new File(rootProject.projectDir, '../../node_modules/@react-native-clipboard/clipboard/android')

include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../../../../node_modules/@react-native/gradle-plugin')

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
2 changes: 1 addition & 1 deletion apps/native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"react-native-pdf": "6.7.5",
"react-native-quick-actions": "0.3.13",
"react-native-quick-base64": "2.1.2",
"react-native-reanimated": "3.12.1",
"react-native-reanimated": "3.16.5",
"react-native-share": "10.2.1",
"react-native-spotlight-search": "2.0.0",
"react-native-svg": "15.2.0",
Expand Down
12 changes: 12 additions & 0 deletions apps/web/pages/en/grants-plaza/grant/[id].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import withApollo from '@island.is/web/graphql/withApollo'
import { withLocale } from '@island.is/web/i18n'
import GrantSinglePage from '@island.is/web/screens/Grants/Grant/Grant'
import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore make web strict
//
const Screen = withApollo(withLocale('en')(GrantSinglePage))

export default Screen

export const getServerSideProps = getServerSidePropsWrapper(Screen)
12 changes: 12 additions & 0 deletions apps/web/pages/en/grants-plaza/grants/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import withApollo from '@island.is/web/graphql/withApollo'
import { withLocale } from '@island.is/web/i18n'
import GrantsSearchResults from '@island.is/web/screens/Grants/SearchResults/SearchResults'
import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore make web strict
//
const Screen = withApollo(withLocale('en')(GrantsSearchResults))

export default Screen

export const getServerSideProps = getServerSidePropsWrapper(Screen)
11 changes: 11 additions & 0 deletions apps/web/pages/en/grants-plaza/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import withApollo from '@island.is/web/graphql/withApollo'
import { withLocale } from '@island.is/web/i18n'
import GrantsHome from '@island.is/web/screens/Grants/Home/GrantsHome'
import { getServerSidePropsWrapper } from '@island.is/web/utils/getServerSidePropsWrapper'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore make web strict
const Screen = withApollo(withLocale('en')(GrantsHome))

export default Screen

export const getServerSideProps = getServerSidePropsWrapper(Screen)
23 changes: 16 additions & 7 deletions apps/web/screens/Grants/Grant/GrantSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useMemo } from 'react'
import { useIntl } from 'react-intl'

import {
Box,
Expand All @@ -16,7 +17,7 @@ import { Grant } from '@island.is/web/graphql/schema'
import { LinkType, useLinkResolver } from '@island.is/web/hooks'

import { m } from '../messages'
import { generateStatusTag } from '../utils'
import { generateStatusTag, parseStatus } from '../utils'

interface Props {
grant: Grant
Expand All @@ -41,7 +42,7 @@ const generateSidebarPanel = (
data: Array<React.ReactElement>,
background: BoxProps['background'],
) => {
if (!data) {
if (!data.length) {
return undefined
}
return (
Expand All @@ -53,7 +54,12 @@ const generateSidebarPanel = (

export const GrantSidebar = ({ grant, locale }: Props) => {
const { linkResolver } = useLinkResolver()
const { formatMessage } = useLocale()
const { formatMessage } = useIntl()

const status = useMemo(
() => parseStatus(grant, formatMessage, locale),
[grant, formatMessage, locale],
)

const detailPanelData = useMemo(
() =>
Expand Down Expand Up @@ -95,20 +101,23 @@ export const GrantSidebar = ({ grant, locale }: Props) => {
),
generateLine(
formatMessage(m.single.deadline),
grant?.applicationDeadlineStatus ? (
<Text variant="medium">{grant.applicationDeadlineStatus}</Text>
status.deadlineStatus ? (
<Text variant="medium">{status.deadlineStatus}</Text>
) : undefined,
),
generateLine(
formatMessage(m.single.status),
grant?.status ? (
<Text variant="medium">
{generateStatusTag(grant.status, formatMessage)?.label}
{
generateStatusTag(status.applicationStatus, formatMessage)
?.label
}
</Text>
) : undefined,
),
].filter(isDefined) ?? [],
[grant, formatMessage, linkResolver],
[grant, formatMessage, linkResolver, status],
)

const filesPanelData = useMemo(
Expand Down
3 changes: 2 additions & 1 deletion apps/web/screens/Grants/Home/GrantsHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ const GrantsHomePage: CustomScreen<GrantsHomeProps> = ({
locale,
customPageData,
}) => {
const { formatMessage } = useIntl()
const intl = useIntl()
const { linkResolver } = useLinkResolver()
const { formatMessage } = intl

const baseUrl = linkResolver('styrkjatorg', [], locale).href
const searchUrl = linkResolver('styrkjatorgsearch', [], locale).href
Expand Down
22 changes: 12 additions & 10 deletions apps/web/screens/Grants/SearchResults/SearchResultsContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useIntl } from 'react-intl'
import { useWindowSize } from 'react-use'
import format from 'date-fns/format'
import { useRouter } from 'next/router'
Expand All @@ -13,7 +12,7 @@ import { Grant } from '@island.is/web/graphql/schema'
import { useLinkResolver } from '@island.is/web/hooks'

import { m } from '../messages'
import { generateStatusTag } from '../utils'
import { generateStatusTag, parseStatus } from '../utils'

interface Props {
grants?: Array<Grant>
Expand Down Expand Up @@ -44,6 +43,7 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => {
return null
}

const status = parseStatus(grant, formatMessage, locale)
return (
<Box key={grant.id}>
{grant.applicationId && (
Expand All @@ -54,11 +54,10 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => {
text={grant.description ?? ''}
logo={grant.fund?.parentOrganization?.logo?.url ?? ''}
logoAlt={grant.fund?.parentOrganization?.logo?.title ?? ''}
tag={
grant.status
? generateStatusTag(grant.status, formatMessage)
: undefined
}
tag={generateStatusTag(
status.applicationStatus,
formatMessage,
)}
cta={{
label: formatMessage(m.general.seeMore),
variant: 'text',
Expand All @@ -80,14 +79,17 @@ export const SearchResultsContent = ({ grants, subheader, locale }: Props) => {
text: `${format(
new Date(grant.dateFrom),
'dd.MM.',
)}-${format(new Date(grant.dateTo), 'dd.MM.yyyy')}`,
)} - ${format(
new Date(grant.dateTo),
'dd.MM.yyyy',
)}`,
}
: null,
grant.applicationDeadlineStatus
status.deadlineStatus
? {
icon: 'time' as const,
//todo: fix when the text is ready
text: grant.applicationDeadlineStatus,
text: status.deadlineStatus,
}
: undefined,
grant.categoryTags
Expand Down
30 changes: 29 additions & 1 deletion apps/web/screens/Grants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const m = {
},
applicationStatus: {
id: 'web.grants:search.applicationStatus',
defaultMessage: 'Staða umsóknar',
defaultMessage: 'Staða umsókna',
},
applicationOpen: {
id: 'web.grants:search.applicationOpen',
Expand All @@ -52,6 +52,34 @@ export const m = {
id: 'web.grants:search.applicationSeeDescription',
defaultMessage: 'Sjá lýsingu',
},
applicationOpensAt: {
id: 'web.grants:search.applicationOpensAt',
defaultMessage: 'Opnar {arg}',
},
applicationEstimatedOpensAt: {
id: 'web.grants:search.applicationEstimatedOpensAt',
defaultMessage: 'Áætlað næst í {arg}',
},
applicationOpensTo: {
id: 'web.grants:search.applicationOpensTo',
defaultMessage: 'Frestur til {arg}',
},
applicationOpensToWithDay: {
id: 'web.grants:search.applicationOpensToWithDay',
defaultMessage: 'Frestur til og með {arg}',
},
applicationWasOpenTo: {
id: 'web.grants:search.applicationWasOpenTo',
defaultMessage: 'Frestur var til {arg}',
},
applicationWasOpenToAndWith: {
id: 'web.grants:search.applicationWasOpenToAndWith',
defaultMessage: 'Frestur var til og með {arg}',
},
applicationAlwaysOpen: {
id: 'web.grants:search.applicationAlwaysOpen',
defaultMessage: 'Opið er allt árið',
},
category: {
id: 'web.grants:search.category',
defaultMessage: 'Flokkun',
Expand Down
Loading

0 comments on commit 3ba2741

Please sign in to comment.