Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #139 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
Release v1.0.3
  • Loading branch information
mgilangjanuar authored Dec 17, 2021
2 parents 4c515f4 + 0e47190 commit e653dec
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: mgilangjanuar
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
open_collective: teledrive
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://paypal.me/mgilangjanuar', 'https://www.buymeacoffee.com/mgilangjanuar']
custom: ['https://paypal.me/mgilangjanuar']
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teledrive",
"version": "1.0.0",
"version": "1.0.3",
"repository": "[email protected]:mgilangjanuar/teledrive.git",
"author": "M Gilang Januar <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions server/.env-example
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ PAYPAL_CLIENT_ID=
PAYPAL_CLIENT_SECRET=
PAYPAL_PLAN_PREMIUM_ID=

MIDTRANS_MERCHANT_ID=
MIDTRANS_CLIENT_KEY=
MIDTRANS_SERVER_KEY=

IS_MAINTENANCE=
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "1.0.0",
"version": "1.0.3",
"main": "dist/index.js",
"license": "MIT",
"private": true,
Expand All @@ -9,7 +9,7 @@
"build": "rimraf dist && eslint --fix -c .eslintrc.js --ext .ts . && tsc"
},
"dependencies": {
"@mgilangjanuar/telegram": "2.0.11",
"@mgilangjanuar/telegram": "2.0.15",
"@sentry/node": "^6.14.1",
"@sentry/tracing": "^6.14.1",
"@types/moment": "^2.13.0",
Expand Down
90 changes: 58 additions & 32 deletions server/src/api/v1/Documents.ts

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions server/src/model/entities/Users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export class Users extends BaseModelWithID {
@Column({ default: null })
subscription_id?: string

@Column({ default: null })
midtrans_id?: string

@Column({ default: null })
plan_expired_at?: Date

Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "1.0.0",
"version": "1.0.3",
"private": true,
"dependencies": {
"@craco/craco": "^6.3.0",
Expand Down
4 changes: 4 additions & 0 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const Login = lazy(
const Terms = lazy(
() => import(/* webpackChunkName: 'TermsPage' */ './pages/Terms')
)
const Refund = lazy(
() => import(/* webpackChunkName: 'RefundPage' */ './pages/Refund')
)
const Privacy = lazy(
() => import(/* webpackChunkName: 'PrivacyPage' */ './pages/Privacy')
)
Expand Down Expand Up @@ -58,6 +61,7 @@ function App(): React.ReactElement {
<Route path="/view/:id" exact component={View} />
<Route path="/login" exact component={Login} />
<Route path="/terms" exact component={Terms} />
<Route path="/refund" exact component={Refund} />
<Route path="/privacy" exact component={Privacy} />
<Route path="/pricing" exact component={Pricing} />
<Route path="/contact" exact component={Contact} />
Expand Down
7 changes: 6 additions & 1 deletion web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,17 @@ const Home: React.FC = () => {
<Col lg={12} span={24} style={{ textAlign: 'left', marginBottom: '30px' }}>
<Typography.Title level={2} style={{ marginBottom: '30px' }}>Our Sponsor</Typography.Title>
<Typography.Paragraph style={{ marginBottom: '20px' }}>
<Space wrap>
<Space wrap size={30}>
<Tooltip placement="bottom" title="Bahasa.ai - Chatbot Which Serves Customers Fully" key="bahasa-ai">
<a href="https://bahasa.ai" target="_blank">
<img style={{ width: '100%', maxWidth: '212px' }} src="https://uploads-ssl.webflow.com/5fb8f118741e70818f103554/5feefbc08ef40333bbd2f92e_bahasa-ai-logo-blue%20(2021)%404x-p-500.png" />
</a>
</Tooltip>
<Tooltip placement="bottom" title="DigitalOcean – The developer cloud" key="digitalocean">
<a href="https://m.do.co/c/d578c43dcd66" target="_blank">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.svg" style={{ width: '100%', maxWidth: '280px' }} />
</a>
</Tooltip>
</Space>
</Typography.Paragraph>
</Col>
Expand Down
22 changes: 15 additions & 7 deletions web/src/pages/Pricing.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ArrowRightOutlined } from '@ant-design/icons'
import { Button, Card, Col, Divider, Layout, Row, Typography } from 'antd'
import { Button, Card, Col, Divider, Layout, notification, Row, Switch, Typography } from 'antd'
import React, { useState } from 'react'
import { useHistory } from 'react-router'
import { Link } from 'react-router-dom'
Expand All @@ -12,6 +12,7 @@ const Pricing: React.FC = () => {
const history = useHistory()
const { data: me } = useSWRImmutable('/users/me', fetcher)
const [loading, setLoading] = useState<boolean>()
const [isIDR, setIsIDR] = useState<boolean>(false)

const select = (plan: 'free' | 'premium' | 'professional' | 'donation') => {
if (plan === 'free' || me?.user.plan === plan) {
Expand Down Expand Up @@ -43,10 +44,13 @@ const Pricing: React.FC = () => {
</ul>
</Card>

const Premium = () => <Card color="warning" hoverable title="Premium" style={{ fontSize: '1rem' }} actions={[<Button block loading={loading} type="text" size="large">Subscribe with<strong> PayPal</strong> <ArrowRightOutlined /></Button>]} onClick={() => select('premium')}>
const Premium = () => <Card color="warning" hoverable title="Premium" style={{ fontSize: '1rem' }} actions={[<Button block loading={loading} type="text" size="large">{isIDR ? <>Powered by<strong> Midtrans</strong></> : <>Subscribe with<strong> PayPal</strong></>} <ArrowRightOutlined /></Button>]} onClick={() => isIDR ? notification.info({ message: 'Coming soon', description: 'Please wait, we\'re on it.' }) : select('premium')}>
<Typography.Title style={{ textAlign: 'center', fontSize: '5em', fontWeight: 300 }}>
<Typography.Text style={{ fontSize: '0.35em' }}>$</Typography.Text>
10
{isIDR ? <>
<Typography.Text style={{ fontSize: '0.35em' }}>Rp</Typography.Text> 144k
</> : <>
<Typography.Text style={{ fontSize: '0.35em' }}>$</Typography.Text> 10
</>}
<Typography.Text style={{ fontSize: '0.35em' }}>/year</Typography.Text>
</Typography.Title>
<ul style={{ textAlign: 'center', listStyleType: 'none' }}>
Expand All @@ -59,12 +63,12 @@ const Pricing: React.FC = () => {

const Donation = () => <div style={{ textAlign: 'center' }}>
<Typography.Title level={2}>
Support us to keep this service running 🚀
Support us to keep this service running
</Typography.Title>
<br />
<Typography.Paragraph>
<a href="https://www.buymeacoffee.com/mgilangjanuar" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style={{ width: '100%', maxWidth: '170px' }} />
<a href="https://opencollective.com/teledrive/contribute" target="_blank">
<img src="https://opencollective.com/teledrive/contribute/button@2x.png?color=blue" style={{ width: '100%', maxWidth: '300px' }} />
</a>
</Typography.Paragraph>
<Typography.Paragraph>
Expand All @@ -74,13 +78,17 @@ const Pricing: React.FC = () => {
<Typography.Paragraph type="secondary">
Feel free to <Link to="/contact?intent=sponsor">contact us</Link> if you have any questions or become a sponsor &mdash; or if you would like to help us in other ways.
</Typography.Paragraph>
{/* <script src="https://opencollective.com/teledrive/banner.js"></script> */}
</div>

return <>
<Navbar user={me} page="pricing" />
<Layout.Content className="container" style={{ marginTop: '80px' }}>
<Row>
<Col md={{ span: 20, offset: 2 }} span={24}>
<Typography.Title level={4} style={{ textAlign: 'center', marginBottom: '70px' }}>
USD 🇺🇸 &nbsp; <Switch onChange={e => setIsIDR(e)} /> &nbsp; IDR 🇮🇩
</Typography.Title>
<Row gutter={48} align="middle">
<Col lg={{ span: 8, offset: 4 }} span={24} style={{ marginBottom: '35px' }}>
<Free />
Expand Down
29 changes: 29 additions & 0 deletions web/src/pages/Refund.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Col, Layout, Row } from 'antd'
import React from 'react'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import useSWRImmutable from 'swr/immutable'
import { fetcher } from '../utils/Fetcher'
import Footer from './components/Footer'
import Navbar from './components/Navbar'

const Terms: React.FC = () => {
const { data } = useSWRImmutable('/documents/refund', fetcher)
const { data: me } = useSWRImmutable('/users/me', fetcher)

return <>
<Navbar page="terms" user={me} />
<Layout.Content className="container">
<Row>
<Col lg={{ span: 18, offset: 3 }} md={{ span: 20, offset: 2 }} span={24}>
<ReactMarkdown className="refund" remarkPlugins={[remarkGfm]}>
{data?.document}
</ReactMarkdown>
</Col>
</Row>
</Layout.Content>
<Footer />
</>
}

export default Terms
32 changes: 21 additions & 11 deletions web/src/pages/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const Footer: React.FC = () => {
return <>
<Layout.Footer style={{ background: '#f0f2f5', paddingTop: '50px' }}>
<Row>
<Col lg={{ span: 16, offset: 4 }} md={{ span: 22, offset: 1 }} span={24}>
<Row gutter={72}>
<Col lg={{ span: 18, offset: 3 }} md={{ span: 24, offset: 1 }} span={24}>
<Row gutter={48}>
<Col md={6} sm={12} span={24} style={{ marginBottom: '30px' }}>
<Typography.Paragraph>
<Button type="link" href="/" style={{ fontSize: '20px', fontWeight: 'bolder' }}
Expand All @@ -25,8 +25,8 @@ const Footer: React.FC = () => {
<Col md={6} sm={12} span={24} style={{ marginBottom: '30px' }}>
<Typography.Title level={5}>Support Us</Typography.Title>
<Typography.Paragraph>
<a href="https://www.buymeacoffee.com/mgilangjanuar" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style={{ width: '100%', maxWidth: '160px' }} />
<a href="https://opencollective.com/teledrive/contribute" target="_blank">
<img src="https://opencollective.com/teledrive/contribute/button@2x.png?color=blue" style={{ width: '100%', maxWidth: '240px' }} />
</a>
</Typography.Paragraph>
<Typography.Paragraph type="secondary">
Expand All @@ -35,13 +35,23 @@ const Footer: React.FC = () => {
</Col>
<Col md={6} sm={12} span={24} style={{ marginBottom: '30px' }}>
<Typography.Title level={5}>Links</Typography.Title>
<Space direction="vertical">
<Link to="/faq">FAQ</Link>
<Link to="/pricing">Pricing</Link>
<Link to="/contact">Contact Us</Link>
<Link to="/privacy">Privacy Policy</Link>
<Link to="/terms">Terms &amp; Conditions</Link>
</Space>
<Row>
<Col span={12}>
<Space direction="vertical">
<Link to="/pricing">Pricing</Link>
<Link to="/contact">Contact Us</Link>
<Link to="/terms">Terms</Link>
<Link target="_blank" to={{ pathname: 'https://mgilangjanuar.notion.site/TeleDrive-Blog-ea8c422dfa8046cda6655cddec0cd8e8' }}>Blog</Link>
</Space>
</Col>
<Col span={12}>
<Space direction="vertical">
<Link to="/faq">FAQ</Link>
<Link to="/privacy">Privacy Policy</Link>
<Link to="/refund">Refund Policy</Link>
</Space>
</Col>
</Row>
</Col>
<Col md={6} sm={12} span={24} style={{ marginBottom: '30px' }}>
<Typography.Title level={5}>Social Media</Typography.Title>
Expand Down
4 changes: 3 additions & 1 deletion web/src/pages/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ const Navbar: React.FC<Props> = ({ user, page }) => {
</Popover> :
<Button onClick={() => history.push('/login')} type="link" style={{ color: '#ffff', float: 'right', top: '16px' }} icon={<LoginOutlined />}>Login</Button>}
<Menu overflowedIndicator={<MenuOutlined />} mode="horizontal" triggerSubMenuAction="click" defaultSelectedKeys={page ? [page] : undefined} theme="dark" style={{ background: '#0088CC', position: 'relative', display: 'flex', justifyContent: 'right' }}>
<Menu.Item onClick={() => history.push('/faq')} key="faq">FAQ</Menu.Item>
<Menu.Item onClick={() => history.push('/pricing')} key="pricing">Pricing</Menu.Item>
<Menu.Item onClick={() => history.push('/faq')} key="faq">FAQ</Menu.Item>
<Menu.Item onClick={() => history.push('/contact')} key="contact">Contact Us</Menu.Item>
<Menu.Item onClick={() => history.push('/privacy')} key="privacy">Privacy Policy</Menu.Item>
<Menu.Item onClick={() => history.push('/terms')} key="terms">Terms</Menu.Item>
<Menu.Item onClick={() => history.push('/refund')} key="refund">Refund Policy</Menu.Item>
<Menu.Item onClick={() => window.open('https://mgilangjanuar.notion.site/TeleDrive-Blog-ea8c422dfa8046cda6655cddec0cd8e8', '_blank')} key="blog">Blog</Menu.Item>
</Menu>
</Layout.Header>

Expand Down
6 changes: 3 additions & 3 deletions web/src/pages/dashboard/components/Messaging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ const Messaging: React.FC<Props> = ({ me, collapsed, parent, setCollapsed }) =>
type: 'file',
title: user ? user.title || `${user.firstName || ''} ${user.lastName || ''}`.trim() : 'Unknown',
titleColor: `#${`${user?.id.toString(16)}000000`.slice(0, 6)}`,
text: `${fileTitle.slice(0, 30)}${fileTitle.length > 30 ? '...' : ''}`,
message: `${fileTitle.slice(0, 30)}${fileTitle.length > 30 ? '...' : ''}`,
text: `${fileTitle.slice(0, 20)}${fileTitle.length > 20 ? '...' : ''}`,
message: `${fileTitle.slice(0, 20)}${fileTitle.length > 20 ? '...' : ''}`,
status: me?.user.tg_id == user?.id ? msg.id <= dialog?.dialog?.readOutboxMaxId ? 'read' : 'received' : undefined,
date: msg.date * 1000,
user,
Expand Down Expand Up @@ -184,7 +184,7 @@ const Messaging: React.FC<Props> = ({ me, collapsed, parent, setCollapsed }) =>
type: 'text',
status: me?.user.tg_id == user?.id ? msg.id <= dialog?.dialog?.readOutboxMaxId ? 'read' : 'received' : undefined,
title: user ? user.title || `${user.firstName || ''} ${user.lastName || ''}`.trim() : 'Unknown',
text: <ReactMarkdown className="messageItem" remarkPlugins={[remarkGfm]}>{msg.message ? `${msg.message.replaceAll('\n', ' \n')}${msg.editDate ? '\n\n_(edited)_' : ''}${msg.fwdFrom ? '\n\n_(forwarded)_' : ''}` : 'Unknown message'}</ReactMarkdown>,
text: <ReactMarkdown className="messageItem" remarkPlugins={[remarkGfm]}>{msg.message ? `${msg.message.replaceAll('\n', ' \n')}${msg.editDate && !msg.editHide ? '\n\n_(edited)_' : ''}${msg.fwdFrom ? '\n\n_(forwarded)_' : ''}` : 'Unknown message'}</ReactMarkdown>,
message: msg.message,
fwdFrom: msg.fwdFrom,
date: msg.date * 1000,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1544,10 +1544,10 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"

"@mgilangjanuar/[email protected].11":
version "2.0.11"
resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.0.11/2b252136afa7cdbda3db412e39793132577da961dfc2f652ca59a2cfe88f1151#3f80099404c5c62bd5bcd30b0a2c5f4aec4a71d8"
integrity sha512-g/OnlhULvwUenJYrJzk/NUywA/QEa5UgPLdHbFtFIemXpbx+ULuR+kOI8HR9Yf7jJH3VXA63zMHr/vrn6RTvGg==
"@mgilangjanuar/[email protected].15":
version "2.0.15"
resolved "https://npm.pkg.github.com/download/@mgilangjanuar/telegram/2.0.15/82fd03396c6b767c7529c4c5ad83a51ca94daed2a9945e6a31356e0a2ecb4ab4#a07f6f545ae6d3001c57b70beba1184c81121287"
integrity sha512-3JiF4IGzkhgJO6CYV9tabedygPBXJi8BS8cKrW1XRwPMioRd+HEJVq4FCeXatDKeShsQLGUGd15t63NTJs+tWw==
dependencies:
"@cryptography/aes" "^0.1.1"
async-mutex "^0.3.0"
Expand Down

0 comments on commit e653dec

Please sign in to comment.