Skip to content

Commit

Permalink
Remove Paywall experiment.
Browse files Browse the repository at this point in the history
  • Loading branch information
MayGo committed Jan 12, 2022
1 parent e32dd27 commit ef0feee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
20 changes: 5 additions & 15 deletions client/src/routes/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Loader } from '../components/Timeline/Loader';
import { CardBox } from '../components/CardBox';
import { TypeSelect } from '../components/TypeSelect';
import { HStack } from '@chakra-ui/react';
import { PaywallOverlay } from '../components/Paywall/PaywallOverlay';

export function SearchPage() {
const fetchIdRef = useRef(0);
Expand All @@ -24,12 +23,7 @@ export function SearchPage() {
const [searchPaging, setSearchPaging] = useState({ pageSize: 20, pageIndex: 0 });

const [searchResult, setSearchResult] = useState([]);
const [timerange, setTimerange] = useState([
moment()
.startOf('day')
.subtract(10, 'days'),
moment().endOf('day'),
]);
const [timerange, setTimerange] = useState([moment().startOf('day').subtract(10, 'days'), moment().endOf('day')]);

const loadItems = async (searchStr, firstPage = false) => {
const fetchId = ++fetchIdRef.current;
Expand Down Expand Up @@ -57,7 +51,7 @@ export function SearchPage() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const exportItems = async searchStr => {
const exportItems = async (searchStr) => {
setIsLoading(true);
const [from, to] = timerange;
await exportFromItems({
Expand All @@ -77,14 +71,13 @@ export function SearchPage() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchPaging]);

const onSubmit = event => {
const onSubmit = (event) => {
event.preventDefault();
setSearchPaging({ ...searchPaging, pageIndex: 0 });
};

return (
<MainLayout>
<PaywallOverlay />
<form onSubmit={onSubmit}>
<Flex p={3} flexDirection="column">
<CardBox position="relative" p={0}>
Expand All @@ -93,14 +86,11 @@ export function SearchPage() {
<SearchOptions setTimerange={setTimerange} timerange={timerange} />
</Box>
<HStack p={4}>
<TypeSelect
value={taskName}
onChange={event => setTaskName(event.target.value)}
/>
<TypeSelect value={taskName} onChange={(event) => setTaskName(event.target.value)} />
<Input
placeholder="Search from all items"
value={searchText}
onChange={event => setSearchText(event.target.value)}
onChange={(event) => setSearchText(event.target.value)}
/>

<Button type="submit" bg="brand.mainColor" w="100px">
Expand Down
2 changes: 0 additions & 2 deletions client/src/routes/SummaryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import { SummaryProvider } from '../SummaryContext';
import { LineChart } from '../components/LineCharts/LineChart';
import { VStack } from '@chakra-ui/react';
import { CardBox } from '../components/CardBox';
import { PaywallOverlay } from '../components/Paywall/PaywallOverlay';

export function SummaryPage() {
return (
<MainLayout>
<PaywallOverlay />
<SummaryProvider>
<VStack p={4} spacing={4}>
<CardBox p={0} position="relative" overflow="hidden">
Expand Down
11 changes: 1 addition & 10 deletions client/src/routes/TimelinePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ import { Timeline } from '../components/Timeline/Timeline';
import { VisibleRange } from '../components/Timeline/VisibleRange';
import { TrackItemTabs } from '../components/TrackItemTable/TrackItemTabs';
import { useInterval } from '../hooks/intervalHook';
import { useStoreActions, useStoreState } from '../store/easyPeasy';
import { PaywallOverlay } from '../components/Paywall/PaywallOverlay';
import moment from 'moment';
import { useStoreActions } from '../store/easyPeasy';

const BG_SYNC_DELAY_MS = 10000;
const TIMELINE_TRIAL_DAYS = 30;

const ItemLabel = (props) => <Text fontSize="md" color={useColorModeValue('gray.700', 'gray.300')} {...props} />;

export function TimelinePage() {
const timerange = useStoreState((state) => state.timerange);
const [beginDate] = timerange;
const fetchTimerange = useStoreActions((actions) => actions.fetchTimerange);
const bgSyncInterval = useStoreActions((actions) => actions.bgSyncInterval);

Expand All @@ -34,12 +29,8 @@ export function TimelinePage() {
fetchTimerange();
}, [fetchTimerange]);

const now = moment();
const showPaywall = now.diff(beginDate, 'days') > TIMELINE_TRIAL_DAYS;

return (
<MainLayout>
{showPaywall && <PaywallOverlay top={130} />}
<VStack p={4} spacing={4}>
<CardBox>
<Flex>
Expand Down
2 changes: 1 addition & 1 deletion electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tockler",
"version": "3.21.6",
"version": "3.21.7",
"description": "Automatically track applications usage and working time",
"author": "Maigo Erit <[email protected]>",
"license": "GPL-2.0",
Expand Down

0 comments on commit ef0feee

Please sign in to comment.