Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update mockup #311

Merged
merged 2 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_⚠️ the application is still a work in progress, hence, Some features are missing. Please see the [issues](https://github.com/opeolluwa/send-file/issues) page to contribute_

![screenshot](./screenshots/filesync.png)
![screenshot](./filesync.png)

## Table of Contents

Expand Down
4 changes: 3 additions & 1 deletion desktop/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const nextConfig = {
images: {
unoptimized: true,
},

experimental: {
externalDir: true,
},
};

module.exports = nextConfig;
Binary file added filesync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 7 additions & 32 deletions mobile/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Redirect, Route } from "react-router-dom";
import {
IonApp,
IonIcon,
Expand All @@ -11,20 +10,11 @@ import {
} from "@ionic/react";
import { IonReactRouter } from "@ionic/react-router";
import {
home,
settings,
time,
homeOutline,
settingsOutline,
timeOutline,
radio,
personCircle,
scan,
home
} from "ionicons/icons";
import { Redirect, Route } from "react-router-dom";

import Home from "./pages/Home";
import History from "./pages/ScanQr";
import Settings from "./pages/Settings";

/* Core CSS required for Ionic components to work properly */
import "@ionic/react/css/core.css";
Expand All @@ -35,12 +25,12 @@ import "@ionic/react/css/structure.css";
import "@ionic/react/css/typography.css";

/* Optional CSS utils that can be commented out */
import "@ionic/react/css/padding.css";
import "@ionic/react/css/display.css";
import "@ionic/react/css/flex-utils.css";
import "@ionic/react/css/float-elements.css";
import "@ionic/react/css/padding.css";
import "@ionic/react/css/text-alignment.css";
import "@ionic/react/css/text-transformation.css";
import "@ionic/react/css/flex-utils.css";
import "@ionic/react/css/display.css";

/**
* Ionic Dark Mode
Expand All @@ -60,7 +50,6 @@ import "./theme/variables.css";
import "./styles/global.css";

import "remixicon/fonts/remixicon.css";
import TransferHistory from "./pages/TransferHistory";
import Share from "./pages/Share";
import SystemInfoStore from "./store/global";

Expand All @@ -75,17 +64,12 @@ const App: React.FC = () => (
<Route exact path="/home">
<Home />
</Route>
<Route exact path="/scan-qr">
<History />
</Route>
<Route path="/settings">
<Settings />
</Route>


<Route path="/share">
<Share />
</Route>
<Route path="/transfer-history">
<TransferHistory />
</Route>
<Route exact path="/">
<Redirect to="/home" />
Expand All @@ -96,15 +80,6 @@ const App: React.FC = () => (
<IonIcon aria-hidden="true" icon={home} />
<IonLabel>Home</IonLabel>
</IonTabButton>
<IonTabButton tab="History" href="/scan-qr">
<IonIcon aria-hidden="true" icon={scan} />
<IonLabel>Scan QR</IonLabel>
</IonTabButton>

<IonTabButton tab="Settings" href="/transfer-history">
<IonIcon aria-hidden="true" icon={time} />
<IonLabel>History</IonLabel>
</IonTabButton>
</IonTabBar>
</IonTabs>
</IonReactRouter>
Expand Down
18 changes: 0 additions & 18 deletions mobile/src/pages/Settings.tsx

This file was deleted.

53 changes: 26 additions & 27 deletions mobile/src/pages/Share.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { IonContent, IonPage } from "@ionic/react";
import Thumbnail from "../components/thumbnail";
import { File } from "@filesync/types/File";
import { Card, Heading, View } from "@filesync/components";
import { Heading, Text, View } from "@filesync/components";
import { CloudArrowUpIcon } from "@heroicons/react/24/outline";
import { useContext } from "react";
import { IonContent, IonPage } from "@ionic/react";
import type { UploadProps } from "antd";
import { message, Upload } from "antd";
import { useContext } from "react";
import { BASE_URL, SystemInformationContext } from "../store/global";

import { IonFab, IonFabButton, IonIcon } from "@ionic/react";
import { add, paperPlane } from "ionicons/icons";

export enum FileTransferStatus {
DOWNLOADING = "downloading",
Expand All @@ -20,7 +19,7 @@ export enum FileTransferStatus {

const Share: React.FC = () => {
const { Dragger } = Upload;
// const { onUpdate } = useContext(FileContext);
// const { onUpdate } = useContext(FileContext);
const { serverBaseUrl } = useContext(SystemInformationContext);
const serverAddress = BASE_URL + "/upload";

Expand Down Expand Up @@ -55,7 +54,9 @@ const Share: React.FC = () => {
// console.log(JSON.stringify(data));
} else if (status === FileTransferStatus.ERROR) {
message.error(
`${info.file.name} file upload failed. due to ${JSON.stringify(info.file.error)}`
`${info.file.name} file upload failed. due to ${JSON.stringify(
info.file.error
)}`
);
}
},
Expand All @@ -68,26 +69,24 @@ const Share: React.FC = () => {
<>
<IonPage id="main-content" className="bg-accent">
<IonContent className="ion-padding">
<Dragger className="h-[300px] block" {...props}>
<CloudArrowUpIcon className="text-app-300 text-center small w-20 mx-auto" />
<p className="text-gray-400 leading-2">
Drop files here to share or click to browse
</p>
</Dragger>



<Card className="flex gap-4 mt-6 hidden">
<Card className="w-1/2 rounded-lg bg-app h-[50px] text-white flex gap-2 items-center justify-start">
<i className="ri-send-plane-line text-2xl text-white bg-app p-2 rounded-full"></i>
<Heading context="Send" className="text-white" />
</Card>
<View className="h-full w-full flex flex-col justify-center items-center">
<Heading className="text-center text-2xl">Share Files</Heading>
<Text className="text-gray-400 leading-5">
Share files with other devices
</Text>
<Dragger className="h-[300px] block mt-2" {...props}>
<CloudArrowUpIcon className="text-app-300 text-center small w-20 mx-auto" />
<p className="text-gray-400 leading-2">
Drop files here to share or click to browse
</p>
</Dragger>
</View>

<Card className="w-1/2 rounded-lg bg-app h-[50px] text-white flex gap-2 items-center justify-start">
<i className="ri-download-cloud-line text-2xl text-white bg-app p-2 rounded-full"></i>
<Heading context="Receive" className="text-white" />
</Card>
</Card>
<IonFab vertical="bottom" horizontal="end" className="mr-8 mb-4">
<IonFabButton>
<IonIcon icon={paperPlane}></IonIcon>
</IonFabButton>
</IonFab>
</IonContent>
</IonPage>
</>
Expand Down
118 changes: 0 additions & 118 deletions mobile/src/pages/TransferHistory.tsx

This file was deleted.