Skip to content

Commit

Permalink
- Improve extension welcome
Browse files Browse the repository at this point in the history
- New upgrade modal
  • Loading branch information
Rustem Mussabekov committed Jun 14, 2024
1 parent 4698de1 commit 9c5d9ba
Show file tree
Hide file tree
Showing 15 changed files with 315 additions and 84 deletions.
7 changes: 7 additions & 0 deletions src/assets/icons/ai_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/assets/icons/reminder_active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 25 additions & 13 deletions src/assets/target/extension/welcome/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ <h3>Pin Raindrop.io Button in Toolbar</h3>
</div>

<div class="text-column">
<h4><span class="text-gradient blue-green-gradient">Sidepanel</span></h4>
<h4><span class="text-gradient blue-green-gradient">Sidebar</span></h4>
<h2>Collection always at hand</h2>
<div class="spacer"></div>

<a href="#open-sidepanel" class="button size-regular variant-primary">Open Sidepanel</a>
<a href="#open-sidepanel" class="button size-regular variant-primary">Open Sidebar</a>

<span class="or-text">or press</span>

Expand All @@ -113,15 +113,27 @@ <h2>Collection always at hand</h2>
<div class="backport-background blue-green-gradient"></div>

<div class="text-container">
<h3>Open Raindrop.io Sidepanel</h3>
<h3>Open Raindrop.io Sidebar</h3>
<ol>
<li data-browser-show="firefox"><a href="https://support.mozilla.org/kb/use-firefox-sidebar-access-bookmarks-history-synced" target="_blank">Add the Sidebar button to your controls</a></li>
<li>Click <svg class="icon"><use xlink:href="#icon-sidepanel"></use></svg> button in a <span class="browser-name"></span> toolbar</li>
<li>In dropdown select <svg class="icon"><use xlink:href="#icon-cloud"></use></svg> Raindrop.io</li>
<li>Raindrop.io will automatically appear the next time you click <svg class="icon"><use xlink:href="#icon-sidepanel"></use></svg> button</li>
<li>Right click <button class="button variant-secondary size-regular" disabled><svg class="icon"><use xlink:href="#icon-cloud"></use></svg></button> Raindrop.io extension icon in a toolbar</li>
<li>In dropdown select <button class="button variant-secondary size-regular" disabled>Open sidebar</button></li>
</ol>
<hr class="pink-red-gradient" />
<p>In sidepanel you can browse your collection, search and add new items.</p>
<p>
Or press

<span data-system-show="macos">
<button class="button size-regular variant-secondary only-icon" disabled></button>
<button class="button size-regular variant-secondary only-icon" disabled></button>
<button class="button size-regular variant-secondary only-icon" disabled>B</button>
</span>
<span data-system-show="windows linux">
<button class="button size-regular variant-secondary" disabled>
Alt+Shift+B
</button>
</span>
</p>
<hr class="blue-green-gradient" />
<p>In sidebar you can browse your collection, search and add new items.</p>
<p>What's cool is that you can simply drag new links and images into this panel to save them.</p>
</div>
</div>
Expand All @@ -134,9 +146,9 @@ <h3>Open Raindrop.io Sidepanel</h3>

<div class="text-column">
<h4><span class="text-gradient blue-purple-gradient">Search Field</span></h4>
<h2>Type in address bar to find items</h2>
<h2>Type <code>rd</code> to find items</h2>
<div class="spacer"></div>
<a href="#start-search" class="button size-regular variant-primary">Start Search</a>
<a href="#start-search" class="button size-regular variant-primary">Learn more</a>
</div>
</div>

Expand All @@ -150,7 +162,7 @@ <h3>Address Bar Integration</h3>
<li>Type the special keyword &nbsp;<button class="button variant-secondary size-regular" disabled>rd</button>&nbsp; followed by a space</li>
<li>Enter your search query, results will appear below</li>
</ol>
<hr class="pink-red-gradient" />
<hr class="blue-purple-gradient" />
<p>Raindrop can search by title, notes, URL, tag, type, date or entire content of web-page, EPUB or PDF (no OCR).</p>
<p>Best in class support for 16 languages. Find precisely by crafting advanced searches with our <a href="https://help.raindrop.io/using-search#operators" target="_blank">super power operators</a>.</p>
</div>
Expand Down Expand Up @@ -276,7 +288,7 @@ <h2>Sync with all of your devices</h2>
</div>

<p data-authenticated-show>
You ready to go!
You ready to go! Close this page and start collecting.
</p>

<div class="spacer"></div>
Expand Down
7 changes: 7 additions & 0 deletions src/assets/target/extension/welcome/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ h2 {
letter-spacing: -.5px;
}

h2 code {
background: var(--secondary-background);
color: var(--secondary-text);
padding: 0 4px;
border-radius: 4px;
}

h3 {
font-size: 32px;
}
Expand Down
26 changes: 21 additions & 5 deletions src/co/bookmarks/edit/form/reminder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useMemo } from 'react'
import React, { useCallback, useMemo, useState } from 'react'
import t from '~t'
import { add, nextSunday } from 'date-fns'
import { useSelector } from 'react-redux'
Expand All @@ -8,7 +8,7 @@ import { DateTime } from '~co/common/form'
import { More, Menu, MenuItem } from '~co/overlay/popover'
import Icon from '~co/common/icon'
import Button from '~co/common/button'
import ProCheck from '~co/user/pro/check'
import UserUpgrade from '~co/user/upgrade'

function Templates({ onSetDate }) {
const templates = useMemo(()=>[
Expand Down Expand Up @@ -37,6 +37,24 @@ function Templates({ onSetDate }) {
)
}

function Free() {
const [show, setShow] = useState(false)
const onClick = useCallback((e)=>{
e.preventDefault()
setShow(true)
}, [setShow])

return (
<>
<Button onClick={onClick} variant='outline'>
<Icon name='reminder' />
</Button>

{show ? <UserUpgrade onClose={()=>setShow(false)} /> : null}
</>
)
}

export default function BookmarkEditFormReminder({ item: { reminder }, onChange, onSave }) {
const pro = useSelector(state=>isPro(state))
const minDate = useMemo(()=>new Date(), [])
Expand All @@ -57,9 +75,7 @@ export default function BookmarkEditFormReminder({ item: { reminder }, onChange,


if (!pro)
return <Button onClick={()=>ProCheck('reminders')} variant='outline'>
<Icon name='reminder' />
</Button>
return <Free />

return reminder.date ? (<>
<DateTime
Expand Down
5 changes: 5 additions & 0 deletions src/co/common/icon/index.module.styl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
height: calc(var(--icon-size) * 3);
}

.icon[data-enlarge='4'] svg, .icon[data-enlarge='4'] {
width: calc(var(--icon-size) * 4);
height: calc(var(--icon-size) * 4);
}

.icon[data-size="micro"] svg, .icon[data-size="micro"] {
width: 0.25rem //10px
height: 0.25rem //10px
Expand Down
8 changes: 6 additions & 2 deletions src/co/highlights/item/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { Text as Note } from '~co/common/form'
import { ShortDate } from '~modules/format/date'
import Button from '~co/common/button'
import Icon from '~co/common/icon'
import ProCheck from '~co/user/pro/check'
import Color from './color'
import UserUpgrade from '~co/user/upgrade'

export default function HighlightsItemView({ text, color, created, pro, onScrollIntoView, onChange, onRemove, ...etc }) {
const noteRef = useRef(null)

const [needUpgrade, setNeedUpgrade] = useState(false)

const [note, setNote] = useState(()=>etc.note)
useEffect(()=>setNote(etc.note), [etc.note])

Expand All @@ -25,7 +27,7 @@ export default function HighlightsItemView({ text, color, created, pro, onScroll
const onClickNote = useCallback(e=>{
if (pro) return
e.preventDefault()
ProCheck('annotations')
setNeedUpgrade(true)
}, [pro])

const onFormMouseDown = useCallback(e=>{
Expand Down Expand Up @@ -85,6 +87,8 @@ export default function HighlightsItemView({ text, color, created, pro, onScroll
</div>
</div>
</div>

{needUpgrade ? <UserUpgrade onClose={()=>setNeedUpgrade(false)} /> : null}
</form>
)
}
39 changes: 0 additions & 39 deletions src/co/user/pro/check.js

This file was deleted.

65 changes: 65 additions & 0 deletions src/co/user/upgrade/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import s from './index.module.styl'
import React, { useCallback } from 'react'
import links from '~config/links'

import Modal, { Content, Header } from '~co/overlay/modal'
import Icon from '~co/common/icon'
import Button from '~co/common/button'

export default function UserUpgrade({ onClose }) {
const onBuyClick = useCallback(()=>onClose(), [onClose])

return (
<Modal
className={s.modal}
onClose={onClose}>
<div className={s.container}>
<div className={s.intro}>
<Icon className={s.icon} name='diamond_active' enlarge='4' />

<svg className={s.noise} xmlns='http://www.w3.org/2000/svg'>
<filter id='noiseFilter'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch' /></filter>
<rect width='100%' height='100%' filter='url(#noiseFilter)' />
</svg>
</div>

<div>
<Header
data-no-shadow
title='Go Pro' />

<Content className={s.content}>
<p>
Unlock powerful features to help you do more with the content you save. <a href={links.pro['help-learn-more']} target='_blank'>Learn more</a>
</p>

<h4>Includes</h4>
<ul>
<li><Icon className={s.icon} name='ai' /> Collection & tag suggestions</li>
<li><Icon className={s.icon} name='sort_score' /> Full-text search</li>
<li><Icon className={s.icon} name='export' /> Forever copies</li>
<li><Icon className={s.icon} name='highlights' /> Annotations</li>
<li><Icon className={s.icon} name='reminder_add' /> Reminders</li>
<li><Icon className={s.icon} name='broken' /> Duplicate & broken links checker</li>
<li><Icon className={s.icon} name='sort_-created' /> Daily backups</li>
</ul>

<p className={s.more}>
And more…
</p>

<div className={s.actions}>
<Button
variant='primary'
href={links.pro.buy}
target='_blank'
onClick={onBuyClick}>
Upgrade
</Button>
</div>
</Content>
</div>
</div>
</Modal>
)
}
Loading

0 comments on commit 9c5d9ba

Please sign in to comment.