Skip to content

Commit

Permalink
remodel settings UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Fmar committed Aug 25, 2023
1 parent 8fbcc7f commit 1f77b64
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 248 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Or you can just download them from the release's page and install it directly wi
- [x] Hashtag Following and Custom Hashtags
- [x] Polls ([NIP-69](https://github.com/nostr-protocol/nips/blob/master/69.md))
- [x] Relay Pages ([NIP-11](https://github.com/nostr-protocol/nips/blob/master/11.md))
- [X] Multiple Accounts
- [ ] Video/LnInvoice Previews
- [ ] Public Chats ([NIP-28](https://github.com/nostr-protocol/nips/blob/master/28.md))
- [ ] Automatic Translations
Expand All @@ -66,7 +67,6 @@ Or you can just download them from the release's page and install it directly wi
- [ ] Login with QR
- [ ] Wallet Connect API ([NIP-47](https://github.com/nostr-protocol/nips/blob/master/47.md))
- [ ] External Identity Support ([NIP-39](https://github.com/nostr-protocol/nips/blob/master/39.md))
- [ ] Multiple Accounts
- [ ] Markdown Support
- [ ] Relay Authentication ([NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md))
- [ ] Content stored in relays themselves ([NIP-95](https://github.com/nostr-protocol/nips/blob/master/95.md))
Expand Down Expand Up @@ -103,9 +103,10 @@ Or you can just download them from the release's page and install it directly wi

## Contributions

Some initial code was used from https://github.com/haorendashu/nostrmo project
Some initial code was used from https://github.com/haorendashu/nostrmo project.\

## Join

I welcome contributors to join the project, specially Designers UI/UX, coders, testers.\
If you're not a coder but would like to see something added/implemented, or you have a great idea for a new feature, just don't hesitate to fill up a issue.
All constructive feedback is welcomed.
3 changes: 1 addition & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
- ~~store private Key in securedStorage~~
- ~~replace relays numbers with search, move numbers to drawer~~
- ~~fix zaps amounts in notes~~
- ~~add theme icon on drawer for quick switching of dark/light theme~~

- badges when something new in home/notifications/DMS
- allow to login with npub
- add SystemMouseCursors.click to everything that is clickable for web version
- add theme icon on drawer for quick switching of dark/light theme
- filter out new posts from replies
- include reposts in following
- integration with https://github.com/greenart7c3/Amber
Expand All @@ -33,7 +33,6 @@
- in thread view decrease the tree branches padding to allow more space for content
- only use tablet second view if horizontal tablet
- fix zooming of pictures and X position
- download followed & zaps in the background, not on demand
- when new user with no following, suggest jack, fiatjaf and others
- Nostr Wallet Connect with balance
- linux AppImage build
Expand Down
32 changes: 11 additions & 21 deletions lib/i18n/i18n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ class I18n {
}

/// `Dark`
String get Dark {
String get Dark_mode {
return Intl.message(
'Dark',
name: 'Dark',
'Dark mode',
name: 'Dark_mode',
desc: '',
args: [],
);
}

/// `Setting`
String get Setting {
String get Settings {
return Intl.message(
'Setting',
name: 'Setting',
Expand All @@ -162,23 +162,13 @@ class I18n {
/// `Theme Style`
String get Theme_Style {
return Intl.message(
'Theme Style',
'Use theme from System',
name: 'Theme_Style',
desc: '',
args: [],
);
}

/// `Theme Color`
String get Theme_Color {
return Intl.message(
'Theme Color',
name: 'Theme_Color',
desc: '',
args: [],
);
}

/// `Default Color`
String get Default_Color {
return Intl.message(
Expand Down Expand Up @@ -262,7 +252,7 @@ class I18n {
/// `Privacy Lock`
String get Privacy_Lock {
return Intl.message(
'Privacy Lock',
'Require unlock to use',
name: 'Privacy_Lock',
desc: '',
args: [],
Expand Down Expand Up @@ -440,10 +430,10 @@ class I18n {
}

/// `Video preview in list`
String get Video_preview_in_list {
String get Video_preview {
return Intl.message(
'Video preview in list',
name: 'Video_preview_in_list',
'Video preview',
name: 'Video_preview',
desc: '',
args: [],
);
Expand Down Expand Up @@ -480,9 +470,9 @@ class I18n {
}

/// `Forbid image`
String get Forbid_image {
String get Image_preview {
return Intl.message(
'Forbid image',
'Image Preview',
name: 'Forbid_image',
desc: '',
args: [],
Expand Down
6 changes: 3 additions & 3 deletions lib/i18n/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Font_Family": MessageLookupByLibrary.simpleMessage("Font Family"),
"Font_Size": MessageLookupByLibrary.simpleMessage("Font Size"),
"Forbid": MessageLookupByLibrary.simpleMessage("Forbid"),
"Forbid_image": MessageLookupByLibrary.simpleMessage("Forbid image"),
"Forbid_image": MessageLookupByLibrary.simpleMessage("Image preview"),
"Forbid_video": MessageLookupByLibrary.simpleMessage("Forbid video"),
"From": MessageLookupByLibrary.simpleMessage("From"),
"Gen_invoice_code_error":
Expand Down Expand Up @@ -224,7 +224,7 @@ class MessageLookup extends MessageLookupByLibrary {
"Posts": MessageLookupByLibrary.simpleMessage("Posts"),
"Posts_and_replies":
MessageLookupByLibrary.simpleMessage("Posts & Replies"),
"Privacy_Lock": MessageLookupByLibrary.simpleMessage("Privacy Lock"),
"Privacy_Lock": MessageLookupByLibrary.simpleMessage("Require unlock to use"),
"Private_key_is_null":
MessageLookupByLibrary.simpleMessage("Private key is null."),
"Quote": MessageLookupByLibrary.simpleMessage("Quote"),
Expand Down Expand Up @@ -258,7 +258,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage(
"The key is a random string that resembles your account password. Anyone with this key can access and control your account."),
"Theme_Color": MessageLookupByLibrary.simpleMessage("Theme Color"),
"Theme_Style": MessageLookupByLibrary.simpleMessage("Theme Style"),
"Theme_Style": MessageLookupByLibrary.simpleMessage("Use Theme from System"),
"There_should_be_a_universe_here": MessageLookupByLibrary.simpleMessage(
"There should be a universe here"),
"This_note_contains_sensitive_content":
Expand Down
2 changes: 1 addition & 1 deletion lib/provider/setting_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SettingProvider extends ChangeNotifier {
int? get openTranslate => _settingData!.openTranslate;

static const ALL_SUPPORT_LANGUAGES =
"af,sq,ar,be,bn,bg,ca,zh,hr,cs,da,nl,en,eo,et,fi,fr,gl,ka,de,el,gu,ht,he,hi,hu,is,id,ga,it,ja,kn,ko,lv,lt,mk,ms,mt,mr,no,fa,pl,pt,ro,ru,sk,sl,es,sw,sv,tl,ta,te,th,tr,uk,ur,vi,cy";
"en";

String? get translateSourceArgs {
if (StringUtil.isNotBlank(_settingData!.translateSourceArgs)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/router/edit/poll_input_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class _PollInputComponent extends State<PollInputComponent> {
onPressed: () {
delPollOption(controller);
},
icon: Icon(Icons.delete)),
icon: const Icon(Icons.delete)),
],
);
}
Expand Down
82 changes: 40 additions & 42 deletions lib/router/index/index_router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,64 +255,62 @@ class _IndexRouter extends CustState<IndexRouter>
floatingActionButton: addBtn,
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
body: Row(children: [
Container(
SizedBox(
width: column0Width,
child: IndexDrawerContnetComponnent(),
child: IndexDrawerContentComponent(reload: widget.reload),
),
Container(
width: column1Width,
margin: EdgeInsets.only(
margin: const EdgeInsets.only(
// left: 1,
right: 1,
),
child: mainIndex,
),
Expanded(
child: Container(
child: Selector<PcRouterFakeProvider, List<RouterFakeInfo>>(
builder: (context, infos, child) {
if (infos.isEmpty) {
return Container(
child: Center(
child: Text(s.There_should_be_a_universe_here),
),
);
}
child: Selector<PcRouterFakeProvider, List<RouterFakeInfo>>(
builder: (context, infos, child) {
if (infos.isEmpty) {
return Container(
child: Center(
child: Text(s.There_should_be_a_universe_here),
),
);
}

List<Widget> pages = [];
for (var info in infos) {
if (StringUtil.isNotBlank(info.routerPath) &&
routes[info.routerPath] != null) {
var builder = routes[info.routerPath];
if (builder != null) {
pages.add(PcRouterFake(
info: info,
child: builder(context),
));
}
} else if (info.buildContent != null) {
List<Widget> pages = [];
for (var info in infos) {
if (StringUtil.isNotBlank(info.routerPath) &&
routes[info.routerPath] != null) {
var builder = routes[info.routerPath];
if (builder != null) {
pages.add(PcRouterFake(
info: info,
child: info.buildContent!(context),
child: builder(context),
));
}
} else if (info.buildContent != null) {
pages.add(PcRouterFake(
info: info,
child: info.buildContent!(context),
));
}
}

return IndexedStack(
index: pages.length - 1,
children: pages,
);
},
selector: (context, _provider) {
return _provider.routerFakeInfos;
},
shouldRebuild: (previous, next) {
if (previous != next) {
return true;
}
return false;
},
),
return IndexedStack(
index: pages.length - 1,
children: pages,
);
},
selector: (context, _provider) {
return _provider.routerFakeInfos;
},
shouldRebuild: (previous, next) {
if (previous != next) {
return true;
}
return false;
},
),
)
]),
Expand All @@ -334,7 +332,7 @@ class _IndexRouter extends CustState<IndexRouter>
floatingActionButtonLocation:
FloatingActionButtonLocation.endFloat,
drawer: Drawer(
child: IndexDrawerContnetComponnent(),
child: IndexDrawerContentComponent(reload: widget.reload),
),
// extendBodyBehindAppBar: true,
bottomNavigationBar: AnimatedContainer(
Expand Down
Loading

0 comments on commit 1f77b64

Please sign in to comment.