Skip to content

Commit

Permalink
search filter fix and offline mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashersam committed May 22, 2021
1 parent f68b545 commit 1b3a5cc
Show file tree
Hide file tree
Showing 44 changed files with 480 additions and 30 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"no-shadow": "off",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"jsx-a11y/click-events-have-key-events": "off",
"react/require-default-props": "off",
"react/forbid-prop-types": "off",
"linebreak-style": 0,
Expand Down
3 changes: 3 additions & 0 deletions renderer/environment.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export const environment = {
production: false,
APPLICATION_ID: 'autographa',
JAVASCRIPT_KEY: 'translation2021',
SERVER_URL: 'https://dev.autographa.org:1337/parse',
};
16 changes: 16 additions & 0 deletions renderer/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/components/*": [
"src/components/*"
],
"@/layouts/*": [
"src/layouts/*"
],
"@/modules/*": [
"src/modules/*"
],
}
}
}
25 changes: 25 additions & 0 deletions renderer/pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable react/prop-types */
import NProgress from 'nprogress';
import Router from 'next/router';
import '../../styles/nprogress.css';
import '../../styles/globals.css';
// import { initializeParse } from '@parse/react-ssr';
// import { environment } from '../environment';

// initializeParse(
// environment.SERVER_URL,
// environment.APPLICATION_ID,
// environment.MASTER_KEY,
// );

Router.events.on('routeChangeStart', () => NProgress.start());
Router.events.on('routeChangeComplete', () => NProgress.done());
Router.events.on('routeChangeError', () => NProgress.done());

function Autographa({ Component, pageProps }) {
return (
<Component {...pageProps} />
);
}

export default Autographa;
22 changes: 22 additions & 0 deletions renderer/pages/_document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Document, {
Html, Head, NextScript, Main,
} from 'next/document';

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps };
}

render() {
return (
<Html>
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
155 changes: 155 additions & 0 deletions renderer/pages/newproject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
import AuthenticationContextProvider from '@/components/Login/AuthenticationContextProvider';
import { Dialog, Transition } from '@headlessui/react';
import { Fragment, useRef, useState } from 'react';

import ProjectsLayout from '@/layouts/ProjectsLayout';
import SelectBook from '@/modules/reference/SelectBook';
import SelectVerse from '@/modules/reference/SelectVerse';
import Notifications from '@/modules/notifications/Notifications';

import { XIcon } from '@heroicons/react/solid';

export default function ReferenceSelector() {
const [openBook, setOpenBook] = useState(false);
const [openVerse, setOpenVerse] = useState(false);

const [book, setBook] = useState('');
const [chapter, setChapter] = useState('');
const [verse, setVerse] = useState('');
const cancelButtonRef = useRef(null);

function closeBooks() {
setOpenBook(false);
}

function openBooks() {
setOpenBook(true);
}

function closeVerses() {
setOpenVerse(false);
}

function openVerses() {
setOpenVerse(true);
}

function selectBook(book) {
setBook(book);
// console.log(book);
setOpenBook(false);
setOpenVerse(true);
}

function selectChapter(chapter) {
setChapter(chapter);
// console.log(chapter);
}

function selectVerse(verse) {
setVerse(verse);
// console.log(book, chapter, verse);
}

return (
<AuthenticationContextProvider>
<ProjectsLayout title="New Project">

<div className="items-center justify-center">
<button
type="button"
onClick={openBooks}
className="px-4 py-2 text-sm font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
>
Books
</button>
{/* <button
type="button"
onClick={openVerses}
className="px-4 py-2 text-sm font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"
>
Chapters
</button> */}
</div>

<Transition
show={openBook}
as={Fragment}
enter="transition duration-100 ease-out"
enterFrom="transform scale-95 opacity-0"
enterTo="transform scale-100 opacity-100"
leave="transition duration-75 ease-out"
leaveFrom="transform scale-100 opacity-100"
leaveTo="transform scale-95 opacity-0"
>
<Dialog
as="div"
className="fixed inset-0 z-10 overflow-y-auto"
initialFocus={cancelButtonRef}
static
open={openBook}
onClose={closeBooks}
>

<Dialog.Overlay className="fixed inset-0 bg-black opacity-30" />

<div className="flex items-center justify-center h-screen ">

<div className="w-5/12 m-auto z-50 shadow overflow-hidden sm:rounded-lg">
<SelectBook selectBook={selectBook}>
<button
type="button"
className="w-9 h-9 bg-black p-2"
onClick={closeBooks}
>
<XIcon />
</button>
</SelectBook>
</div>
</div>

</Dialog>
</Transition>

<Transition
show={openVerse}
as={Fragment}
enter="transition duration-100 ease-out"
enterFrom="transform scale-95 opacity-0"
enterTo="transform scale-100 opacity-100"
leave="transition duration-75 ease-out"
leaveFrom="transform scale-100 opacity-100"
leaveTo="transform scale-95 opacity-0"
>
<Dialog
as="div"
className="fixed inset-0 z-10 overflow-y-auto"
initialFocus={cancelButtonRef}
static
open={openVerse}
onClose={closeVerses}
>

<Dialog.Overlay className="fixed inset-0 bg-black opacity-30" />
<div className="flex items-center justify-center h-screen">

<div className=" w-3/12 m-auto z-50 bg-black text-white shadow overflow-hidden sm:rounded-lg">
<SelectVerse selectChapter={selectChapter} selectVerse={selectVerse}>
<button
type="button"
className="w-9 h-9 bg-black p-2"
onClick={closeVerses}
>
<XIcon />
</button>
</SelectVerse>
</div>
</div>

</Dialog>
</Transition>

</ProjectsLayout>
</AuthenticationContextProvider>
);
}
10 changes: 10 additions & 0 deletions renderer/pages/profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Profile from '@/modules/projects/Profile';
import AuthenticationContextProvider from '@/components/Login/AuthenticationContextProvider';

const profile = () => (
<AuthenticationContextProvider>
<Profile />
</AuthenticationContextProvider>
);

export default profile;
13 changes: 13 additions & 0 deletions renderer/pages/projects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ProjectList from '@/modules/projects/ProjectList';
import AuthenticationContextProvider from '@/components/Login/AuthenticationContextProvider';
import AutographaContextProvider from '@/components/AutogrpahaContext/AutographaContext';

const projects = () => (
<AuthenticationContextProvider>
<AutographaContextProvider>
<ProjectList />
</AutographaContextProvider>
</AuthenticationContextProvider>
);

export default projects;
10 changes: 10 additions & 0 deletions renderer/pages/sync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Sync from '@/modules/projects/Sync';
import AuthenticationContextProvider from '@/components/Login/AuthenticationContextProvider';

const projects = () => (
<AuthenticationContextProvider>
<Sync />
</AuthenticationContextProvider>
);

export default projects;
5 changes: 5 additions & 0 deletions renderer/public/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added renderer/public/brands/door43.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added renderer/public/brands/gitea.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added renderer/public/brands/paratext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions renderer/public/icons/new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions renderer/public/icons/projects.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions renderer/public/icons/sync.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions renderer/public/illustrations/add-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions renderer/public/illustrations/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions renderer/public/illustrations/clear-button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions renderer/public/illustrations/down-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1b3a5cc

Please sign in to comment.