-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make days keyboard calendar like (#19)
- `<NoopButton/>` implemented. - `dates` utility methods refactored, `Day` class created, related tests updated. - Limit of the days in days list keyboard increased from 7 to 8. - Keyboard of days list now renders as calendar.
- Loading branch information
Showing
10 changed files
with
310 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { TgxElement } from '@telegum/tgx' | ||
import type { InstallFn } from '.' | ||
|
||
const CALLBACK_QUERY_DATA = 'noop' | ||
|
||
export function NoopButton({ children }: { children?: string }): TgxElement { | ||
return <button data={CALLBACK_QUERY_DATA}>{children || ' '}</button> | ||
} | ||
|
||
export const install: InstallFn = (bot) => { | ||
bot.callbackQuery(CALLBACK_QUERY_DATA, async (ctx, next) => { | ||
await ctx.answerCallbackQuery({ cache_time: 300 }) | ||
return next() | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const TIMEZONE = 'Europe/Moscow' | ||
export const TRAININGS_DAYS_LIST_COUNT = 7 | ||
export const TRAININGS_DAYS_LIST_COUNT = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.