Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
subscreen: Show ann.url as a qrcode
Browse files Browse the repository at this point in the history
  • Loading branch information
sorah committed May 3, 2023
1 parent 1324304 commit e3f0cee
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
- [ ] __IMPORTANT__ なんか chat session expiry の判定あやしいかも
- [ ] 幕間 hls pull のディレイへらす

## Setup
## Development

## AWS Setup

IVS and Chime SDK for Messaging are uncovered by Terraform :/

Expand Down
18 changes: 14 additions & 4 deletions app/javascript/SubScreenAnnouncementsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import loadable, { lazy } from "@loadable/component";
import { Track } from "./Api";
import { Api } from "./Api";

import { Box, Skeleton } from "@chakra-ui/react";
import { Box, Flex, Skeleton } from "@chakra-ui/react";

import dayjs from "dayjs";
import { QRCodeSVG } from "qrcode.react";

const TICK_INTERVAL = 1;
const ROTATE_INTERVAL = 12;
Expand Down Expand Up @@ -36,9 +37,18 @@ export const SubScreenAnnouncementsView: React.FC<{ track: Track }> = ({ track }
console.log("ann", ann);
return (
<React.Suspense fallback={<Skeleton w="100%" h="100%" />}>
<Box fontSize="3.6vw" w="100%" h="100%">
{returnToBr(ann.content)}
</Box>
<Flex w="100%" h="100%" direction="row" justify="space-between">
<Box fontSize="3.6vw" w="100%" h="100%">
{returnToBr(ann.content)}
</Box>
{ann.url ? (
<>
<Box css={{ "& svg": { height: "100%", width: "auto" } }} bgColor="white">
<QRCodeSVG value={ann.url} level={"M"} includeMargin={true} size={300} />
</Box>
</>
) : null}
</Flex>
</React.Suspense>
);
};
Expand Down
7 changes: 5 additions & 2 deletions app/jobs/sync_conference_data_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require 'open-uri'

class SyncConferenceDataJob < ApplicationJob
DEFAULT_SPEAKERS_URL = 'https://rubykaigi.org/2022/data/speakers.yml'
DEFAULT_PRESENTATIONS_URL = 'https://rubykaigi.org/2022/data/presentations.yml'
DEFAULT_SPEAKERS_URL = 'https://rubykaigi.org/2023/data/speakers.yml'
DEFAULT_PRESENTATIONS_URL = 'https://rubykaigi.org/2023/data/presentations.yml'

def perform(speakers_url_add: [], presentations_url_add: [])
ApplicationRecord.transaction do
Expand Down Expand Up @@ -79,6 +79,9 @@ def upload_speaker_avatars
body: io,
)
end
rescue OpenURI::HTTPError
p $!

end
end
end
Expand Down
10 changes: 6 additions & 4 deletions tf/aws.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ locals {
}

provider "aws" {
alias = "apne1"
region = "ap-northeast-1"
allowed_account_ids = [local.aws_account_id]
default_tags {
tags = {
Project = "takeout-app"
Project = "takeout-app"
Component = "takeout-app"
}
}
}
Expand All @@ -19,7 +19,8 @@ provider "aws" {
allowed_account_ids = [local.aws_account_id]
default_tags {
tags = {
Project = "takeout-app"
Project = "takeout-app"
Component = "takeout-app"
}
}
}
Expand All @@ -30,7 +31,8 @@ provider "aws" {
allowed_account_ids = [local.aws_account_id]
default_tags {
tags = {
Project = "takeout-app"
Project = "takeout-app"
Component = "takeout-app"
}
}
}
8 changes: 3 additions & 5 deletions tf/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ resource "aws_s3_bucket_policy" "rk-takeout-app" {
##########

resource "aws_s3_bucket" "rk-takeout-app-apne1" {
provider = aws.apne1
bucket = "rk-takeout-app"
bucket = "rk-takeout-app"
}

data "aws_iam_policy_document" "s3-rk-takeout-app-apne1" {
Expand Down Expand Up @@ -87,7 +86,6 @@ data "aws_iam_policy_document" "s3-rk-takeout-app-apne1" {
}

resource "aws_s3_bucket_policy" "rk-takeout-app-apne1" {
provider = aws.apne1
bucket = aws_s3_bucket.rk-takeout-app-apne1.id
policy = data.aws_iam_policy_document.s3-rk-takeout-app-apne1.json
bucket = aws_s3_bucket.rk-takeout-app-apne1.id
policy = data.aws_iam_policy_document.s3-rk-takeout-app-apne1.json
}

0 comments on commit e3f0cee

Please sign in to comment.