-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathproblems.lua
55 lines (41 loc) · 1.17 KB
/
problems.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
local cmd = require("leetcode.command")
local config = require("leetcode.config")
local Title = require("leetcode-ui.lines.title")
local Button = require("leetcode-ui.lines.button.menu")
local BackButton = require("leetcode-ui.lines.button.menu.back")
local Buttons = require("leetcode-ui.group.buttons.menu")
local Page = require("leetcode-ui.group.page")
local footer = require("leetcode-ui.lines.footer")
local header = require("leetcode-ui.lines.menu-header")
local page = Page()
page:insert(header)
page:insert(Title({ "Menu" }, "Problems"))
local list = Button("List", {
icon = "",
sc = "p",
on_press = cmd.problems,
})
local random = Button("Random", {
icon = "",
sc = "r",
on_press = cmd.random_question,
})
local daily = Button("Daily", {
icon = "",
sc = "d",
on_press = cmd.qot,
})
local companies = Button("Companies", {
icon = "",
sc = "c",
on_press = cmd.companies,
})
local back = BackButton("menu")
button_list = { list, random, daily }
if config.auth.is_premium then
table.insert(button_list, companies)
end
table.insert(button_list, back)
page:insert(Buttons(button_list))
page:insert(footer)
return page