mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added app.openSearcher
This commit is contained in:
parent
0d06de438f
commit
ba14f0247b
@ -55,7 +55,7 @@ import { Translation } from "react-i18next"
|
|||||||
import { Session, User } from "models"
|
import { Session, User } from "models"
|
||||||
import config from "config"
|
import config from "config"
|
||||||
|
|
||||||
import { NotFound, RenderError, Crash, Settings, Navigation, Login, UserRegister, Creator } from "components"
|
import { NotFound, RenderError, Crash, Settings, Navigation, Login, UserRegister, Creator, Searcher } from "components"
|
||||||
import { Icons } from "components/Icons"
|
import { Icons } from "components/Icons"
|
||||||
|
|
||||||
import Layout from "./layout"
|
import Layout from "./layout"
|
||||||
@ -114,6 +114,9 @@ class App extends React.Component {
|
|||||||
window.electron.ipcRenderer.invoke("app.minimize")
|
window.electron.ipcRenderer.invoke("app.minimize")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"app.openSearcher": () => {
|
||||||
|
return App.publicMethods.openSearcher()
|
||||||
|
},
|
||||||
"app.openCreator": (...args) => {
|
"app.openCreator": (...args) => {
|
||||||
return App.publicMethods.openCreator(...args)
|
return App.publicMethods.openCreator(...args)
|
||||||
},
|
},
|
||||||
@ -256,6 +259,9 @@ class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static publicMethods = {
|
static publicMethods = {
|
||||||
|
openSearcher: (options) => {
|
||||||
|
window.app.ModalController.open((props) => <Searcher {...props} />)
|
||||||
|
},
|
||||||
openCreator: () => {
|
openCreator: () => {
|
||||||
window.app.ModalController.open((props) => <Creator {...props} />)
|
window.app.ModalController.open((props) => <Creator {...props} />)
|
||||||
},
|
},
|
||||||
@ -279,6 +285,9 @@ class App extends React.Component {
|
|||||||
goToAccount: (username) => {
|
goToAccount: (username) => {
|
||||||
return window.app.setLocation(`/@${username}`)
|
return window.app.setLocation(`/@${username}`)
|
||||||
},
|
},
|
||||||
|
goToPost: (id) => {
|
||||||
|
return window.app.setLocation(`/post/${id}`)
|
||||||
|
},
|
||||||
isAppCapacitor: () => window.navigator.userAgent === "capacitor",
|
isAppCapacitor: () => window.navigator.userAgent === "capacitor",
|
||||||
setStatusBarStyleDark: async () => {
|
setStatusBarStyleDark: async () => {
|
||||||
if (!window.app.isAppCapacitor()) {
|
if (!window.app.isAppCapacitor()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user