diff --git a/package-lock.json b/package-lock.json index ac4904e5..c41d3a62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -357,6 +357,11 @@ "postcss-value-parser": "3.3.0" } }, + "autosize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/autosize/-/autosize-4.0.0.tgz", + "integrity": "sha1-egWZsbqE1zvXWJsNnaOHAVLGkjc=" + }, "aws-sign2": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", diff --git a/package.json b/package.json index d3336846..72d0f63d 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dependencies": { "@gamestdio/websocket": "^0.2.2", "a11y-dialog": "^4.0.1", + "autosize": "^4.0.0", "cheerio": "^1.0.0-rc.2", "child-process-promise": "^2.2.1", "chokidar": "^2.0.0", diff --git a/routes/_actions/instances.js b/routes/_actions/instances.js index 06828191..adfb9149 100644 --- a/routes/_actions/instances.js +++ b/routes/_actions/instances.js @@ -67,6 +67,10 @@ export async function updateVerifyCredentialsForInstance (instanceName) { ) } +export async function updateVerifyCredentialsForCurrentInstance () { + await updateVerifyCredentialsForInstance(store.get('currentInstance')) +} + export async function updateInstanceInfo (instanceName) { await cacheFirstUpdateAfter( () => getInstanceInfo(instanceName), diff --git a/routes/_components/compose/LiteComposeBox.html b/routes/_components/compose/LiteComposeBox.html new file mode 100644 index 00000000..401116d8 --- /dev/null +++ b/routes/_components/compose/LiteComposeBox.html @@ -0,0 +1,139 @@ +
+
+ + + {{verifyCredentials.display_name || verifyCredentials.acct}} + + + {{'@' + verifyCredentials.acct}} + + + +
+
+ + \ No newline at end of file diff --git a/routes/_store/instanceComputations.js b/routes/_store/instanceComputations.js index 1769a346..bc2f5f18 100644 --- a/routes/_store/instanceComputations.js +++ b/routes/_store/instanceComputations.js @@ -101,4 +101,9 @@ export function instanceComputations (store) { (statusModifications, currentInstance) => { return statusModifications[currentInstance] }) + + store.compute('currentInputTextInCompose', + ['inputTextInCompose', 'currentInstance'], + (inputTextInCompose, currentInstance) => (inputTextInCompose[currentInstance] || '') + ) } diff --git a/routes/_store/store.js b/routes/_store/store.js index 0bf43cfb..f8473aa3 100644 --- a/routes/_store/store.js +++ b/routes/_store/store.js @@ -13,7 +13,8 @@ const KEYS_TO_STORE_IN_LOCAL_STORAGE = new Set([ 'loggedInInstancesInOrder', 'autoplayGifs', 'markMediaAsSensitive', - 'pinnedPages' + 'pinnedPages', + 'inputTextInCompose' ]) class PinaforeStore extends LocalStorageStore { @@ -37,7 +38,8 @@ export const store = new PinaforeStore({ instanceLists: {}, pinnedStatuses: {}, instanceInfos: {}, - statusModifications: {} + statusModifications: {}, + inputTextInCompose: {} }) mixins(PinaforeStore) diff --git a/routes/index.html b/routes/index.html index 8c98a0f0..87801d74 100644 --- a/routes/index.html +++ b/routes/index.html @@ -4,9 +4,12 @@ {{#if $isUserLoggedIn}} - + {{#if $currentVerifyCredentials}} + + {{/if}} + {{else}} - + {{/if}} @@ -15,6 +18,7 @@ import Layout from './_components/Layout.html' import NotLoggedInHome from './_components/NotLoggedInHome.html' import LazyTimeline from './_components/timeline/LazyTimeline.html' + import LiteComposeBox from './_components/compose/LiteComposeBox.html' import { store } from './_store/store.js' export default { @@ -22,7 +26,8 @@ components: { Layout, LazyTimeline, - NotLoggedInHome + NotLoggedInHome, + LiteComposeBox } } diff --git a/routes/settings/instances/[instanceName].html b/routes/settings/instances/[instanceName].html index 965d3acd..3d455479 100644 --- a/routes/settings/instances/[instanceName].html +++ b/routes/settings/instances/[instanceName].html @@ -62,6 +62,9 @@ :global(.acct-handle) { grid-area: handle; } + .acct-display-name { + grid-area: display-name; + } .theme-chooser { background: var(--form-bg); border: 1px solid var(--main-border); diff --git a/routes/settings/instances/add.html b/routes/settings/instances/add.html index 3cf35c40..3bd3c907 100644 --- a/routes/settings/instances/add.html +++ b/routes/settings/instances/add.html @@ -51,7 +51,7 @@ background-color: var(--main-bg); } input.new-instance-input { - min-width: 50%; + min-width: 60%; max-width: 100%; } @@ -67,12 +67,6 @@ display: block; margin: 20px 5px; } - - @media (max-width: 767px) { - input.new-instance-input { - max-width: 80%; - } - }