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

Frontend design #15

Merged
merged 19 commits into from
Oct 24, 2023
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
13 changes: 8 additions & 5 deletions cmd/crossposting-service/di/inject_adapters.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ var adaptersSet = wire.NewSet(
wire.Bind(new(app.RelayEventDownloader), new(*adapters.RelayEventDownloader)),

twitter.NewTwitter,
twitter.NewNoopTwitter,
twitter.NewDevelopmentTwitter,
selectTwitterAdapterDependingOnConfig,

adapters.NewTwitterAccountDetailsCache,
wire.Bind(new(app.TwitterAccountDetailsCache), new(*adapters.TwitterAccountDetailsCache)),
)

func newAdaptersFactoryFn(deps buildTransactionSqliteAdaptersDependencies) sqlite.AdaptersFactoryFn {
Expand Down Expand Up @@ -103,11 +106,11 @@ func newSqliteDB(conf config.Config, logger logging.Logger) (*sql.DB, func(), er

func selectTwitterAdapterDependingOnConfig(
conf config.Config,
realAdapter *twitter.Twitter,
noopAdapter *twitter.NoopTwitter,
productionAdapter *twitter.Twitter,
developmentAdapter *twitter.DevelopmentTwitter,
) app.Twitter {
if conf.Environment() == config.EnvironmentDevelopment {
return noopAdapter
return developmentAdapter
}
return realAdapter
return productionAdapter
}
3 changes: 3 additions & 0 deletions cmd/crossposting-service/di/inject_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ var applicationSet = wire.NewSet(
app.NewGetAccountPublicKeysHandler,
app.NewLoginOrRegisterHandler,
app.NewLinkPublicKeyHandler,
app.NewGetTwitterAccountDetailsHandler,
app.NewLogoutHandler,
app.NewUnlinkPublicKeyHandler,
)
21 changes: 14 additions & 7 deletions cmd/crossposting-service/di/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/nos-crossposting-service-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"core-js": "^3.8.3",
"vue": "^3.2.13",
"vue-class-component": "^8.0.0-0",
"vue-property-decorator": "^9.1.2",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<title>X Connect</title>
</head>
<body>
<noscript>
Expand Down
108 changes: 85 additions & 23 deletions frontend/nos-crossposting-service-frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,84 @@
<template>
<h1>
Nos crossposting service
{{ user }}
</h1>
<router-view/>
<div class="wrapper">
<Header></Header>
<div class="content">
<Notifications></Notifications>
<router-view/>
</div>
</div>
</template>

<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
@font-face {
font-family: 'Clarity City';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("./assets/fonts/claritycity/ClarityCity-Regular.otf") format('opentype');
}

@font-face {
font-family: 'Clarity City';
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("./assets/fonts/claritycity/ClarityCity-Medium.otf") format('opentype');
}

@font-face {
font-family: 'Clarity City';
font-style: normal;
font-weight: 600;
font-display: swap;
src: url("./assets/fonts/claritycity/ClarityCity-SemiBold.otf") format('opentype');
}

@font-face {
font-family: 'Clarity City';
font-style: normal;
font-weight: 700;
font-display: swap;
src: url("./assets/fonts/claritycity/ClarityCity-Bold.otf") format('opentype');
}

html, body {
padding: 0;
margin: 0;
color: #fff;
min-height: 100vh;

font-family: 'Clarity City', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}

nav {
padding: 30px;
html {
background: linear-gradient(#160f24, #281945);
}

body {
background-image: url("./assets/background.svg");
background-position: right center;
background-repeat: no-repeat;
background-size: auto 100%;
}

a {
font-weight: bold;
color: #2c3e50;
#app {
.wrapper {
padding: 4em;

&.router-link-exact-active {
color: #42b983;
.content {
padding: 0 4em;
}
}
}

@media screen and (max-width: 1200px) {
#app {
.wrapper {
.content {
padding: 0;
}
}
}
}
Expand All @@ -33,18 +88,25 @@ nav {
import {Options, Vue} from 'vue-class-component';
import {useStore} from "vuex";
import {APIService} from "@/services/APIService";
import Header from "@/components/Header.vue";
import Notifications from "@/components/Notifications.vue";
import {Mutation} from "@/store";

@Options({})
@Options({
components: {
Notifications,
Header,
}
})
export default class App extends Vue {

private readonly apiService = new APIService(useStore());
private readonly store = useStore();

created() {
this.loadCurrentUser();
}

private loadCurrentUser(): void {
created(): void {
this.apiService.refreshCurrentUser()
.catch(() => {
this.store.commit(Mutation.PushNotificationError, "Error loading the user.");
});
}
}
</script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions frontend/nos-crossposting-service-frontend/src/assets/delete.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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading