Skip to content

Commit f270315

Browse files
committed
Release v0.1.9
1 parent 73c2e9f commit f270315

File tree

9 files changed

+104
-12
lines changed

9 files changed

+104
-12
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ New features to keep an eye on;
2525
- [x] Google Drive link to Mega.nz link
2626
- [x] Direct download link to Google Drive link
2727
- [x] Direct download link to Mega.nz link
28-
- [ ] Google Drive link to direct download link
29-
- [ ] Mega.nz to direct download link
28+
- [x] Google Drive link to direct download link
29+
- [x] Mega.nz to direct download link
3030
- [ ] Torrents to Google Drive link
3131
- [ ] Torrents to Mega.nz link
3232
- [ ] Torrents to direct download link

Diff for: package-lock.json

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "niwder-ui",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"private": true,
55
"dependencies": {
66
"@emotion/react": "^11.8.2",
@@ -41,7 +41,8 @@
4141
"build": "react-scripts build",
4242
"test": "react-scripts test",
4343
"eject": "react-scripts eject",
44-
"deploy": "set CI=true npm i && npm run build && firebase deploy"
44+
"deploy": "set CI=true npm i && npm run build && firebase deploy && npm run clean",
45+
"clean": "rimraf build .firebase"
4546
},
4647
"eslintConfig": {
4748
"extends": [
@@ -61,5 +62,8 @@
6162
"last 1 safari version"
6263
]
6364
},
64-
"proxy": "https://niwder-api.niweera.gq"
65+
"proxy": "https://niwder-api.niweera.gq",
66+
"devDependencies": {
67+
"rimraf": "^3.0.2"
68+
}
6569
}

Diff for: src/components/Home/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ const Home = () => {
8383
3. Direct download link to Google Drive link
8484
<br />
8585
4. Direct download link to Mega.nz link
86+
<br />
87+
5. Google Drive link to direct download link
88+
<br />
89+
6. Mega.nz link to direct download link
8690
</Typography>
8791
<Typography
8892
variant="h6"

Diff for: src/components/Navbar/MenuListItems.js

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ const MenuListItems = ({ anchorEl, handleClose, classes }) => {
7777
>
7878
<MenuItem onClick={handleClose}>Google Drive to Direct</MenuItem>
7979
</NavLink>
80+
<NavLink
81+
to={"/transfers/mega-to-direct"}
82+
className={({ isActive }) =>
83+
isActive ? classes.linkTextActive : classes.linkText
84+
}
85+
>
86+
<MenuItem onClick={handleClose}>Mega.nz to Direct</MenuItem>
87+
</NavLink>
8088
</Menu>
8189
);
8290
};

Diff for: src/components/Transfers/MegaToDirect/index.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React from "react";
2+
import { queueTransfer } from "../../../store/actions";
3+
import TransfersBase from "../TransfersBase";
4+
import SecondaryComponent from "../TransfersBase/SecondaryComponent";
5+
import TransferringComponent from "../TransfersBase/TransferringComponent";
6+
import { faLink } from "@fortawesome/free-solid-svg-icons/faLink";
7+
import { megaRe } from "../../../config/Constants";
8+
import { faM } from "@fortawesome/free-solid-svg-icons/faM";
9+
10+
const secondary = ({ megaLink, directLink, size, mimeType, timestamp }) => (
11+
<SecondaryComponent
12+
primaryLink={directLink}
13+
primaryText={"Direct Link"}
14+
secondaryLink={megaLink}
15+
secondaryText={"Mega.nz Link"}
16+
size={size}
17+
mimeType={mimeType}
18+
timestamp={timestamp}
19+
primaryIcon={faLink}
20+
secondaryIcon={faM}
21+
/>
22+
);
23+
24+
const transferring = ({ message, percentage }) => (
25+
<TransferringComponent primaryText={message} percentage={percentage} />
26+
);
27+
28+
const MegaToDirect = () => {
29+
return (
30+
<TransfersBase
31+
dbPath={"mega-to-direct"}
32+
regExpString={megaRe}
33+
validationErrorMessage={
34+
"The URL must be a valid Mega.nz file/folder export URL"
35+
}
36+
submitFN={queueTransfer}
37+
title={<>Add a Mega.nz link to convert to a Direct link</>}
38+
placeholder={"Mega.nz Link"}
39+
secondaryComponent={secondary}
40+
transferringComponent={transferring}
41+
/>
42+
);
43+
};
44+
45+
export default MegaToDirect;

Diff for: src/components/Transfers/index.js

+20
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,26 @@ const Transfers = () => {
336336
Transfer from Google Drive to Direct Link
337337
</Button>
338338
</NavLink>
339+
340+
<NavLink
341+
to={"/transfers/mega-to-direct"}
342+
className={classes.linkTextActive}
343+
>
344+
<Button
345+
fullWidth
346+
variant="contained"
347+
size="large"
348+
startIcon={
349+
<Box className={classes.box} component="span">
350+
<FontAwesomeIcon icon={faM} size="xs" color="#d9272e" />{" "}
351+
<ArrowRightAltIcon />
352+
<FontAwesomeIcon icon={faLink} size="xs" />
353+
</Box>
354+
}
355+
>
356+
Transfer from Mega.nz to Direct Link
357+
</Button>
358+
</NavLink>
339359
</ButtonGroup>
340360
</CardContent>
341361
</Card>

Diff for: src/helpers/useFCMNotifications.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@ import { messaging } from "../config";
33

44
const useFCMNotifications = (setNotification, setNotificationOpen) => {
55
useEffect(() => {
6+
let unsubscribe;
7+
68
if (messaging) {
7-
const unsubscribe = messaging.onMessage(
9+
unsubscribe = messaging.onMessage(
810
(payload) => {
911
setNotification(payload?.notification || payload?.data);
1012
setNotificationOpen(true);
1113
},
1214
(error) => console.log(error)
1315
);
14-
15-
return () => {
16-
unsubscribe && unsubscribe();
17-
};
1816
}
17+
18+
return () => {
19+
unsubscribe?.();
20+
};
1921
}, [setNotification, setNotificationOpen]);
2022
};
2123

Diff for: src/routes.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import GDriveToMega from "./components/Transfers/GDriveToMega";
1616
import DirectToGDrive from "./components/Transfers/DirectToGDrive";
1717
import DirectToMega from "./components/Transfers/DirectToMega";
1818
import GDriveToDirect from "./components/Transfers/GDriveToDirect";
19+
import MegaToDirect from "./components/Transfers/MegaToDirect";
1920
import PrivacyPolicy from "./components/PrivacyPolicy";
2021
import TermsOfService from "./components/TermsOfService";
2122

@@ -73,6 +74,11 @@ const RoutesComponent = () => {
7374
path={"/transfers/gdrive-to-direct"}
7475
element={<GDriveToDirect />}
7576
/>
77+
<Route
78+
exact
79+
path={"/transfers/mega-to-direct"}
80+
element={<MegaToDirect />}
81+
/>
7682
</Route>
7783
<Route exact path={"*"} element={<NotFound />} />
7884
</Routes>

0 commit comments

Comments
 (0)