Skip to content

Commit

Permalink
Merge pull request #124 from medyo/develop
Browse files Browse the repository at this point in the history
Develop 1.16.0 (Minor)
  • Loading branch information
medyo authored Feb 4, 2023
2 parents 6fc7a70 + bbac80a commit 746aa84
Show file tree
Hide file tree
Showing 29 changed files with 1,164 additions and 394 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
6 changes: 6 additions & 0 deletions public/base.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
"version": "1.15.10",
"chrome_url_overrides": {
"newtab": "index.html"
},
"icons": {
"16": "/logos/logo16.png",
"32": "/logos/logo32.png",
"48": "/logos/logo48.png",
"128": "/logos/logo128.png"
}
}
38 changes: 33 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
import { useState, useEffect } from 'react'
import React, { Suspense, useEffect, useLayoutEffect, useState } from 'react'
import 'react-contexify/dist/ReactContexify.css'
import 'src/assets/App.css'
import { Footer, Header } from 'src/components/Layout'
import { BookmarksSidebar } from 'src/features/bookmarks'
import { MarketingBanner } from 'src/features/MarketingBanner'
import { ScrollCardsNavigator } from './components/Layout'
import { AppContentLayout } from './components/Layout'
import 'react-contexify/dist/ReactContexify.css'
import { setupAnalytics, trackPageView, setupIdentification } from 'src/lib/analytics'
import { setupAnalytics, setupIdentification, trackPageView } from 'src/lib/analytics'
import { useUserPreferences } from 'src/stores/preferences'
import { diffBetweenTwoDatesInDays } from 'src/utils/DateUtils'
import { AppContentLayout, ScrollCardsNavigator } from './components/Layout'
import { isWebOrExtensionVersion } from './utils/Environment'
import { getAppVersion } from './utils/Os'

const OnboardingModal = React.lazy(() =>
import('src/features/onboarding').then((module) => ({ default: module.OnboardingModal }))
)

function App() {
const [showSideBar, setShowSideBar] = useState(false)
const [showSettings, setShowSettings] = useState(false)
const [showOnboarding, setShowOnboarding] = useState(true)
const { onboardingCompleted, firstSeenDate, markOnboardingAsCompleted } = useUserPreferences()

useLayoutEffect(() => {
if (!onboardingCompleted && getAppVersion() <= '1.15.9') {
const usageDays = diffBetweenTwoDatesInDays(firstSeenDate, Date.now())
if (usageDays > 0) {
markOnboardingAsCompleted(null)
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [onboardingCompleted, firstSeenDate])

useEffect(() => {
setupAnalytics()
Expand All @@ -21,7 +40,16 @@ function App() {
return (
<>
<MarketingBanner />

<div className="App">
{!onboardingCompleted && isWebOrExtensionVersion() === 'extension' && (
<Suspense fallback={null}>
<OnboardingModal
showOnboarding={showOnboarding}
setShowOnboarding={setShowOnboarding}
/>
</Suspense>
)}
<Header
setShowSideBar={setShowSideBar}
showSideBar={showSideBar}
Expand Down
Loading

0 comments on commit 746aa84

Please sign in to comment.