Skip to content
This repository has been archived by the owner on Dec 24, 2022. It is now read-only.

Commit

Permalink
some features fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
osscode-r committed Mar 19, 2022
1 parent f95ae90 commit b9ca3dd
Show file tree
Hide file tree
Showing 33 changed files with 575 additions and 448 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
release
src/renderer/dist/
4 changes: 2 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [Creating A Pull Request](#creating-a-pull-request)
- [License](https://github.com/raghavyuva/LucaMail/blob/master/LICENSE)
- [License](#license)
- [Authors](#authors)
- [Donate](#donate)

Expand Down Expand Up @@ -120,4 +120,4 @@ Distributed under the GPL-3.0 License. See [LICENSE](https://github.com/raghavyu
If you find this project as useful then do donate so that the project is maintained up-to date.
use this platform for donation.

- [kofi-com](https://ko-fi.com/raghavyuva)
<a href='https://ko-fi.com/raghavyuva' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' />
6 changes: 6 additions & 0 deletions docs/PRcreating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Creating A Pull Request
- Fork the Project
- Create your Feature Branch (`git checkout -b feature/newfeature`)
- Commit your Changes (`git commit -m 'Add some newfeature'`)
- Push to the Branch (`git push origin feature/newfeature`)
- Open a Pull Request
19 changes: 19 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

- If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/raghavyuva/LucaMail/issues/new) to discuss it, or directly create a pull request after you edit the _README.md_ file with necessary changes.
- Please make sure you check your spelling and grammar.
- Kindly Look into the issue if you are trying to work on, if it really is a bug then only work on that
- If you are Having a great idea and wants to implement the feature on LucaMail? then please do contact me before implementing so that i will be aware of what feature you are working so that there'll be no confliction!
- Create individual PR for each suggestion.
- be proud that you are contributing :)


### Creating A Pull Request

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/newfeature`)
3. Commit your Changes (`git commit -m 'Add some newfeature'`)
4. Push to the Branch (`git push origin feature/newfeature`)
5. Open a Pull Request
2 changes: 1 addition & 1 deletion src/renderer/components/ListMail/CardForMailList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import { HiOutlineStar, HiStar } from "react-icons/hi";
import { MdOutlineMarkChatUnread, MdStar } from "react-icons/md";
import { MdOutlineMarkChatUnread, } from "react-icons/md";
function CardForMailList({
Data,
username,
Expand Down
17 changes: 10 additions & 7 deletions src/renderer/components/ListMail/ListBigCard.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HiOutlineStar, HiStar } from "react-icons/hi";
import React, { useState } from "react";
import { MdOutlineMarkChatUnread } from "react-icons/md";
import { MdOutlineMarkChatRead, MdOutlineMarkChatUnread } from "react-icons/md";
const ListBigCard = ({
username,
subject,
Expand Down Expand Up @@ -43,8 +43,8 @@ const ListBigCard = ({
{subject[0] ? subject[0] : username[0]}
</span>
</div>
<div className="flex flex-col">
<span className="text-MailCardSenderText font-mono font-semibold">
<div className="flex flex-col max-w-sm">
<span className="text-MailCardSenderText font-mono font-semibold">
{subject}
</span>
</div>
Expand All @@ -54,8 +54,8 @@ const ListBigCard = ({
</div>
</div>
<div>
<div className="p-2 flex justify-between ">
<span className="text-MailCardSenderText text-sm capitalize text-clip truncate ">
<div className="p-2 flex justify-between max-w-xs ">
<span className="text-MailCardSenderText text-sm capitalize ">
{username ? username : ""}
</span>
{!localread ? (
Expand All @@ -64,9 +64,12 @@ const ListBigCard = ({
setlocalread(!localread);
CheckForSelectedDiv(messageId, "seen");
}}
className="bg-MailCardReadButtonBackground px-1 py-1 rounded-br-xl rounded-tl-xl shadow-xl self-end"
className=" px-1 py-1 rounded-br-xl rounded-tl-xl shadow-xl self-end"
>
<span className="text-sm text-MailCardReadButtonText">read</span>
<MdOutlineMarkChatRead
size={18}
className="text-MailCardUnreadIcon"
/>
</div>
) : (
<MdOutlineMarkChatUnread
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/ListMail/ListMail.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { AddFlag, GetSingleMail, RemoveFlag } from "../../services";
import { GetSingleMail, } from "../../services";
import CardForMailList from "./CardForMailList";
import ListTopIcons from "./ListTopIcons";
import { useLocation } from "react-router-dom";
Expand Down
10 changes: 7 additions & 3 deletions src/renderer/components/ListMail/ListTopIcons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
MdViewCompact,
MdViewList,
} from "react-icons/md";
import { Link } from "react-router-dom";
import { Link, useLocation } from "react-router-dom";
import PaginationComp from "./PaginationComp";

function ListTopIcons({
Expand All @@ -19,13 +19,14 @@ function ListTopIcons({
setGridView,
message,
}) {
const location = useLocation();
return (
<div className="flex flex-col text-text ">
<div className=" flex mt-4 items-center justify-evenly">
<div className="flex flex-row">
<MdRefresh
size={30}
className="mr-2 cursor-pointer "
className="ml-1 mr-2 cursor-pointer "
onClick={Refresh}
title="Refresh"
/>
Expand Down Expand Up @@ -58,6 +59,9 @@ function ListTopIcons({
to={{
pathname: "/tableView",
}}
state={{
path: location?.pathname,
}}
>
<MdTableView
title="table view"
Expand All @@ -67,7 +71,7 @@ function ListTopIcons({
</Link>
}
</div>
<span className="font-mono font-semibold mr-4">
<span className="font-mono font-semibold mr-2">
{Data?.length} Fetched Messages
</span>
<div className="hidden lg:flex">
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/components/Loading/Loading.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React from "react";
import TitleBar from "~/components/TopBar/WindowBar";
import Icon from '../../../main/helpers/lucamail.png'
import './loading.css'

function Loading({ icon }) {
return (
<div className="bg-LoadingBackground text-LoadingText">
<>
<TitleBar icon={icon} />
<div className="flex flex-col justify-center items-center h-[calc(100vh_-_2rem)]">
<div className="flex items-center typewriter">
<div className="flex flex-col items-center ">
<h1 className="text-3xl font-bold capitalize leading-loose mr-4 ">
hang on while luca is bringing mail for you
hang on while luca is setting up mail for you
</h1>
<div aria-label="Loading..." role="status">
<img src={Icon} className="w-32 h-32 animate-bounce" />
</div>
<img
src="https://camo.githubusercontent.com/09b4eefc1e15caef9a2e732fba9d4a5c4baf1a57c8a1ea21bcb3b639a3c5457d/68747470733a2f2f696d6775722e636f6d2f74637258454b4b2e706e67"
className="w-32 h-32 mt-10 animate-bounce"
/>
</div>
</div>
</>
Expand Down
29 changes: 0 additions & 29 deletions src/renderer/components/Loading/loading.css

This file was deleted.

4 changes: 2 additions & 2 deletions src/renderer/components/Login/InputField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function InputField({
<div className="relative">
<input
type={visible ? label : "text"}
className="w-full p-4 pr-12 text-sm text-primary-text border bg-primary-background rounded-lg shadow-lg "
className="w-full p-4 pr-12 text-sm text-text border bg-background rounded-lg shadow-lg "
placeholder={placeholder}
onChange={(e) => updatedValue(e.target.value)}
value={value}
Expand All @@ -25,7 +25,7 @@ function InputField({
Icon && <span className="absolute inset-y-0 inline-flex items-center right-4">
<Icon
size={25}
className='text-primary-text'
className='text-text'
onClick={() => {
visible!=null && setvisible(!visible)
}}
Expand Down
40 changes: 35 additions & 5 deletions src/renderer/components/Settings/Settings.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import React, { useState } from "react";
import { SettingTypes } from "~/static/constants/Settings";
import {
GetUserHome,
inboxpath,
Parser,
} from "../../utils/provider/folderProvider";
import Button from "../Basic/Button";
import InputField from "../Login/InputField";
import GeneralSettings from "./GeneralSettings";
import ThemeSettings from "./ThemeSettings";
const fs = require("fs");
Expand All @@ -11,24 +17,41 @@ function Settings({ params }) {
const [Checked, setChecked] = useState(
localval ? localval : SettingTypes["boolvaled"]
);
const [fetchlimit, setfetchlimit] = useState();
const [activelabel, setactivelabel] = useState(
SettingTypes["TabHeaders"][0].label
);
const [CustomThemeFile, setCustomThemeFile] = useState();
function OnApplyChanges() {
if (fetchlimit && fetchlimit > 0) {
let val = Parser(inboxpath(GetUserHome(), "conf"));
let tLen = val?.mailStatus?.messages;
if (tLen > fetchlimit) {
StoreSettings(fetchlimit);
} else {
StoreSettings(tLen);
}
} else {
StoreSettings();
}
}


function StoreSettings(flimit) {
localStorage.setItem("Settings", JSON.stringify(Checked));
if (Checked[2].default == false) {
if (flimit) {
localStorage.setItem("fetchlimit", JSON.stringify(flimit));
}
alert("changes applied");
}

return (
<section className="w-full bg-background text-text px-4">
<section className="w-full bg-SettingsCardBackground text-SettingsCardText px-4">
<nav className="p-4 flex text-sm font-medium max-w-fit">
{SettingTypes?.TabHeaders?.map((e) => (
<button
onClick={() => setactivelabel(e.label)}
className={` p-4 -mb-px border-b border-b-SideBarBackground ${
className={` p-4 text-SettingsCardTitle -mb-px border-b border-b-SideBarBackground ${
activelabel == e.label && "border-b-primary"
} `}
title={e.label}
Expand All @@ -38,9 +61,9 @@ function Settings({ params }) {
))}
</nav>
<div className="flex flex-col ">
<div className="w-full mt-4 mx-auto bg-white shadow-2xl rounded-sm ">
<div className="w-full mt-4 mx-auto shadow-2xl rounded-sm ">
<div className="p-3">
<div className="overflow-x-auto max-w-screen-xl">
<div className="overflow-x-auto max-w-screen-xl bg-SettingsCardBackground">
{activelabel == "General Settings" && (
<>
{Checked.map((e, index) => (
Expand All @@ -59,6 +82,13 @@ function Settings({ params }) {
Data={e}
/>
))}
<div className="mt-4">
<InputField
placeholder="Enter Number of Mails to fetch at once"
value={fetchlimit}
updatedValue={setfetchlimit}
/>
</div>
<Button handler={OnApplyChanges} btntext="save changes" />
</>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/components/Settings/ThemeSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
if (ReadStream) {
WriteFile(themepath, JSON.parse(ReadStream));
applyTheme(JSON.parse(ReadStream)?.preferred, user?.auth?.user);
alert("changes applied");
CheckThemes();
}
} catch (error) {
Expand All @@ -69,6 +70,7 @@ const ThemeSettings = ({ CustomThemeFile, setCustomThemeFile, user }) => {
let obj = Themes;
obj.preferred = selected;
WriteFile(themepath, obj);
alert("changes applied");
}
} else {
localStorage.setItem("preferredtheme", selected);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/ShowMail/AttachMents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function AttachMents({
}

return (
<div class="flex flex-col p-4 bg-CardBackground justify-center shadow-lg rounded-xl m-2" >
<div class="flex flex-col p-4 bg-MailCardBackground justify-center shadow-lg rounded-xl m-2" >
<span class="p-2 text-text rounded-lg bg-gray-50"
onClick={() => fileDownload(file)}
>
Expand All @@ -26,7 +26,7 @@ function AttachMents({
<span>
{bytesToSize(file?.size)}
</span>
<p class="hidden mt-1 text-sm text-gray-500 sm:block">{type ? type.substring(type.lastIndexOf("/") + 1) : ""}</p>
<p class="hidden mt-1 text-sm sm:block">{type ? type.substring(type.lastIndexOf("/") + 1) : ""}</p>
</div>
)
}
Expand Down
Loading

0 comments on commit b9ca3dd

Please sign in to comment.