Skip to content

Commit

Permalink
fix: Rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlaa committed Apr 26, 2023
1 parent 0357b14 commit a606f21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
6 changes: 3 additions & 3 deletions source/sites/publicodes/conference/FilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useContext, useState } from 'react'
import { useTranslation } from 'react-i18next'
import NumberFormat from 'react-number-format'
import { useSelector } from 'react-redux'
import { TrackerContext } from '../../../contexts/TrackerContext'
import { TrackingContext } from '../../../contexts/TrackingContext'

export default ({ threshold, setThreshold, setContextFilter }) => {
const tracker = useContext(TrackerContext)
const { trackEvent } = useContext(TrackingContext)

const [visible, setVisible] = useState(false)
const survey = useSelector((state) => state.survey)
Expand Down Expand Up @@ -37,7 +37,7 @@ export default ({ threshold, setThreshold, setContextFilter }) => {
title={t('Ouvrir les options de tri')}
onClick={() => {
setVisible(true)
tracker.push(['trackEvent', 'Mode Groupe', 'Ouvre filtres'])
trackEvent(['trackEvent', 'Mode Groupe', 'Ouvre filtres'])
}}
>
<div
Expand Down
6 changes: 3 additions & 3 deletions source/sites/publicodes/conference/GroupStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
import Checkbox from '../../../components/ui/Checkbox'
import Progress from '../../../components/ui/Progress'
import { TrackerContext } from '../../../contexts/TrackerContext'
import { TrackingContext } from '../../../contexts/TrackingContext'
import {
getLangFromAbreviation,
getLangInfos,
Expand Down Expand Up @@ -37,7 +37,7 @@ export default ({
setThreshold,
existContext,
}) => {
const tracker = useContext(TrackerContext)
const { trackEvent } = useContext(TrackingContext)
const { t, i18n } = useTranslation()
const currentLangInfos = getLangInfos(getLangFromAbreviation(i18n.language))

Expand Down Expand Up @@ -149,7 +149,7 @@ export default ({
showLabel
checked={!realTimeMode}
onChange={() => {
tracker.push([
trackEvent([
'trackEvent',
'Mode groupe',
realTimeMode
Expand Down
10 changes: 4 additions & 6 deletions source/sites/publicodes/pages/news/NewsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { localStorageKey } from 'Components/NewsBanner'
import { MarkdownWithAnchorLinks } from 'Components/utils/markdown'
import Meta from 'Components/utils/Meta'
import { ScrollToTop } from 'Components/utils/Scroll'
import { useEffect } from 'react'
import emoji from 'react-easy-emoji'
Expand All @@ -12,10 +13,9 @@ import {
useNavigate,
} from 'react-router-dom'
import styled from 'styled-components'
import Meta from '../components/utils/Meta'
import { usePersistingState } from '../hooks/usePersistState'
import { getCurrentLangInfos, Release } from '../locales/translation'
import { capitalise0 } from '../utils'
import { usePersistingState } from '../../../../hooks/usePersistState'
import { getCurrentLangInfos, Release } from '../../../../locales/translation'
import { capitalise0 } from '../../../../utils'

export const dateCool = (date: Date, abrvLocale: string) =>
date.toLocaleString(abrvLocale, {
Expand Down Expand Up @@ -51,8 +51,6 @@ export default function NewsItem() {
const data = sortReleases(currentLangInfos.releases),
lastRelease = data && data[0]

console.log(data)

useEffect(() => {
setLastViewedRelease(lastRelease.name)
}, [])
Expand Down
6 changes: 2 additions & 4 deletions source/sites/publicodes/pages/news/NewsList.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import { localStorageKey } from 'Components/NewsBanner'
import { usePersistingState } from 'Components/utils/persistState'
import { ScrollToTop } from 'Components/utils/Scroll'
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { getCurrentLangInfos } from 'Source/locales/translation'
import { usePersistingState } from '../../../../hooks/usePersistState'
import { dateCool, extractImage, getPath, sortReleases } from './NewsItem'

export default () => {
const { t, i18n } = useTranslation()
const { i18n } = useTranslation()
const currentLangInfos = getCurrentLangInfos(i18n)
const [, setLastViewedRelease] = usePersistingState(localStorageKey, null)

const data = sortReleases(currentLangInfos.releases),
lastRelease = data && data[0]

console.log(data)

useEffect(() => {
setLastViewedRelease(lastRelease.name)
}, [])
Expand Down

0 comments on commit a606f21

Please sign in to comment.