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

Added google drive as a provider to sync notes. #257

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react';

const CloudSyncComponent = () => {
const providers = [
{ name: 'Joplin Cloud', value: 'joplin' },
{ name: 'Dropbox', value: 'dropbox' },
{ name: 'OneDrive', value: 'onedrive' },
{ name: 'Google Drive', value: 'google' },
];

const handleProviderSelect = (provider) => {
window.location.href = `${process.env.REACT_APP_BACKEND_URL}/auth/${provider}`;
};

return (
<div>
<h2>Select a Provider to Sync Your Notes</h2>
<div className="provider-list">
{providers.map((provider) => (
<button
key={provider.value}
onClick={() => handleProviderSelect(provider.value)}
className="provider-button"
>
{provider.name}
</button>
))}
</div>
</div>
);
};

export default CloudSyncComponent;
18 changes: 18 additions & 0 deletions packages/app-desktop/gui/NoteList/googleDrive/googleStrategy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const passport = require('passport');
const GoogleStrategy = require('passport-google-oauth20').Strategy;

passport.use(new GoogleStrategy({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: '/auth/google/callback',
}, (accessToken, refreshToken, profile, done) => {
done(null, { profile, accessToken });
}));

passport.serializeUser((user, done) => {
done(null, user);
});

passport.deserializeUser((obj, done) => {
done(null, obj);
});
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ function NoteListControls(props: Props) {
if (breakpoint === dynamicBreakpoints.Sm) {
return 'icon-note';
} else {
return 'fas fa-plus';
return 'fas fa-pencil-alt';
}
}, [breakpoint, dynamicBreakpoints]);

const todoIcon = useMemo(() => {
if (breakpoint === dynamicBreakpoints.Sm) {
return 'far fa-check-square';
} else {
return 'fas fa-plus';
return 'fas fa-pencil-alt';
}
}, [breakpoint, dynamicBreakpoints]);

Expand Down
2 changes: 1 addition & 1 deletion packages/app-desktop/gui/NoteSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class NoteSearchBar extends React.Component<Props> {
onKeyDown={this.searchInput_keyDown}
ref="searchInput"
type="text"
style={{ width: 200, marginRight: 5, backgroundColor: this.backgroundColor, color: theme.color }}
style={{ width: 200, marginRight: 5, backgroundColor: this.backgroundColor, color: theme.color, fontSize: 'x-large' }}
/>
{allowScrolling ? previousButton : null}
{allowScrolling ? nextButton : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getEmptyFolderMessage = (folders: FolderEntity[], selectedFolderId: string
}

if (Setting.value('appType') === 'desktop') {
return _('No notes in here. Create one by clicking on "New note".');
return _('No notes in here. Click "New note" to start adding your notes.');
} else {
return _('There are currently no notes. Create one by clicking on the (+) button.');
}
Expand Down