Skip to content

Commit 84119f1

Browse files
committed
Release v0.1.10
1 parent 991a171 commit 84119f1

File tree

8 files changed

+176
-4
lines changed

8 files changed

+176
-4
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ New features to keep an eye on;
2727
- [x] Direct download link to Mega.nz link
2828
- [x] Google Drive link to direct download link
2929
- [x] Mega.nz to direct download link
30-
- [ ] Torrents to Google Drive link
31-
- [ ] Torrents to Mega.nz link
32-
- [ ] Torrents to direct download link
30+
- [x] Torrents to Google Drive link
31+
- [x] Torrents to Mega.nz link
32+
- [x] Torrents to direct download link
3333

3434
Niwder is live on https://niwder.niweera.gq.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "niwder-ui",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"private": true,
55
"dependencies": {
66
"@emotion/react": "^11.8.2",

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

+18
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import {
1111
GDRIVE_TO_MEGA_ROUTE,
1212
MEGA_TO_DIRECT_ROUTE,
1313
MEGA_TO_GDRIVE_ROUTE,
14+
TORRENTS_TO_DIRECT_ROUTE,
1415
TORRENTS_TO_GDRIVE_ROUTE,
16+
TORRENTS_TO_MEGA_ROUTE,
1517
} from "../../config/Constants";
1618

1719
const MenuListItems = ({ anchorEl, handleClose, classes }) => {
@@ -102,6 +104,22 @@ const MenuListItems = ({ anchorEl, handleClose, classes }) => {
102104
>
103105
<MenuItem onClick={handleClose}>Torrents to Google Drive</MenuItem>
104106
</NavLink>
107+
<NavLink
108+
to={TORRENTS_TO_MEGA_ROUTE}
109+
className={({ isActive }) =>
110+
isActive ? classes.linkTextActive : classes.linkText
111+
}
112+
>
113+
<MenuItem onClick={handleClose}>Torrents to Mega.nz</MenuItem>
114+
</NavLink>
115+
<NavLink
116+
to={TORRENTS_TO_DIRECT_ROUTE}
117+
className={({ isActive }) =>
118+
isActive ? classes.linkTextActive : classes.linkText
119+
}
120+
>
121+
<MenuItem onClick={handleClose}>Torrents to Direct</MenuItem>
122+
</NavLink>
105123
</Menu>
106124
);
107125
};

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

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

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

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

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

+50
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import {
3030
GDRIVE_TO_MEGA_ROUTE,
3131
MEGA_TO_DIRECT_ROUTE,
3232
MEGA_TO_GDRIVE_ROUTE,
33+
TORRENTS_TO_DIRECT_ROUTE,
3334
TORRENTS_TO_GDRIVE_ROUTE,
35+
TORRENTS_TO_MEGA_ROUTE,
3436
} from "../../config/Constants";
3537
import { faMagnet } from "@fortawesome/free-solid-svg-icons/faMagnet";
3638

@@ -394,6 +396,54 @@ const Transfers = () => {
394396
Transfer from Torrents to Google Drive
395397
</Button>
396398
</NavLink>
399+
400+
<NavLink
401+
to={TORRENTS_TO_MEGA_ROUTE}
402+
className={classes.linkTextActive}
403+
>
404+
<Button
405+
fullWidth
406+
variant="contained"
407+
size="large"
408+
startIcon={
409+
<Box className={classes.box} component="span">
410+
<FontAwesomeIcon
411+
icon={faMagnet}
412+
size="xs"
413+
color="#ffeeb4"
414+
/>{" "}
415+
<ArrowRightAltIcon />
416+
<FontAwesomeIcon icon={faM} size="xs" color="#d9272e" />
417+
</Box>
418+
}
419+
>
420+
Transfer from Torrents to Mega.nz
421+
</Button>
422+
</NavLink>
423+
424+
<NavLink
425+
to={TORRENTS_TO_DIRECT_ROUTE}
426+
className={classes.linkTextActive}
427+
>
428+
<Button
429+
fullWidth
430+
variant="contained"
431+
size="large"
432+
startIcon={
433+
<Box className={classes.box} component="span">
434+
<FontAwesomeIcon
435+
icon={faMagnet}
436+
size="xs"
437+
color="#ffeeb4"
438+
/>{" "}
439+
<ArrowRightAltIcon />
440+
<FontAwesomeIcon icon={faLink} size="xs" />
441+
</Box>
442+
}
443+
>
444+
Transfer from Torrents to Direct Link
445+
</Button>
446+
</NavLink>
397447
</ButtonGroup>
398448
</CardContent>
399449
</Card>

Diff for: src/config/Constants.js

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export const DIRECT_TO_MEGA_QUEUE = "direct-to-mega";
1313
export const GDRIVE_TO_DIRECT_QUEUE = "gdrive-to-direct";
1414
export const MEGA_TO_DIRECT_QUEUE = "mega-to-direct";
1515
export const TORRENTS_TO_GDRIVE_QUEUE = "torrents-to-gdrive";
16+
export const TORRENTS_TO_MEGA_QUEUE = "torrents-to-mega";
17+
export const TORRENTS_TO_DIRECT_QUEUE = "torrents-to-direct";
1618

1719
export const MEGA_TO_GDRIVE_ROUTE = `/transfers/${MEGA_TO_GDRIVE_QUEUE}`;
1820
export const GDRIVE_TO_MEGA_ROUTE = `/transfers/${GDRIVE_TO_MEGA_QUEUE}`;
@@ -21,3 +23,5 @@ export const DIRECT_TO_MEGA_ROUTE = `/transfers/${DIRECT_TO_MEGA_QUEUE}`;
2123
export const GDRIVE_TO_DIRECT_ROUTE = `/transfers/${GDRIVE_TO_DIRECT_QUEUE}`;
2224
export const MEGA_TO_DIRECT_ROUTE = `/transfers/${MEGA_TO_DIRECT_QUEUE}`;
2325
export const TORRENTS_TO_GDRIVE_ROUTE = `/transfers/${TORRENTS_TO_GDRIVE_QUEUE}`;
26+
export const TORRENTS_TO_MEGA_ROUTE = `/transfers/${TORRENTS_TO_MEGA_QUEUE}`;
27+
export const TORRENTS_TO_DIRECT_ROUTE = `/transfers/${TORRENTS_TO_DIRECT_QUEUE}`;

Diff for: src/routes.js

+14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import DirectToMega from "./components/Transfers/DirectToMega";
1818
import GDriveToDirect from "./components/Transfers/GDriveToDirect";
1919
import MegaToDirect from "./components/Transfers/MegaToDirect";
2020
import TorrentsToGDrive from "./components/Transfers/TorrentsToGDrive";
21+
import TorrentsToMega from "./components/Transfers/TorrentsToMega";
22+
import TorrentsToDirect from "./components/Transfers/TorrentsToDirect";
2123
import PrivacyPolicy from "./components/PrivacyPolicy";
2224
import TermsOfService from "./components/TermsOfService";
2325
import {
@@ -27,7 +29,9 @@ import {
2729
GDRIVE_TO_MEGA_ROUTE,
2830
MEGA_TO_DIRECT_ROUTE,
2931
MEGA_TO_GDRIVE_ROUTE,
32+
TORRENTS_TO_DIRECT_ROUTE,
3033
TORRENTS_TO_GDRIVE_ROUTE,
34+
TORRENTS_TO_MEGA_ROUTE,
3135
} from "./config/Constants";
3236

3337
const AuthIsLoaded = ({ children }) => {
@@ -94,6 +98,16 @@ const RoutesComponent = () => {
9498
path={TORRENTS_TO_GDRIVE_ROUTE}
9599
element={<TorrentsToGDrive />}
96100
/>
101+
<Route
102+
exact
103+
path={TORRENTS_TO_MEGA_ROUTE}
104+
element={<TorrentsToMega />}
105+
/>
106+
<Route
107+
exact
108+
path={TORRENTS_TO_DIRECT_ROUTE}
109+
element={<TorrentsToDirect />}
110+
/>
97111
</Route>
98112
<Route exact path={"*"} element={<NotFound />} />
99113
</Routes>

0 commit comments

Comments
 (0)